Skip to content

Issue adding covariates to tsps model #13

@isabelamorita

Description

@isabelamorita

Hi,

I'm encountering an issue when specifying different covariates for the first and second stages in a tsps model.

For example: tsps("outcome ~ exposure + covariates_stage2 | instrument + covariates_stage1")

I'd like to include covariates only in the second stage (covariates_stage2) and not in the first stage (covariates_stage1). However, when I try this, I get the following error:

Error in moments[, i] <- (X - linearpredictor) * Zwithcons[, i] : incorrect number of subscripts on matrix

Do I need to include the same covariates in both stages? Or is there a way to specify covariates only for the second stage without this error?

Any help would be appreciated!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions