Skip to content

Management of binary outcome and missing data using interaction terms in glm_weightit #74

@kgkirgkiris

Description

@kgkirgkiris

Hi Noah,

I want to start by expressing my sincere thanks, not only for this incredible package but also for everything you have done to make propensity score weighting and matching both accessible and easy to interpret. I have come across countless answers from you on StackExchange and GitHub, and I have learned so much from them. Your contribution has been invaluable. I am sure many others feel the same way. Thank you.

My questions concern estimating effects after weighting. I have a continuous treatment variable and several covariates for a binary outcome. May the proposed algorithm for fitting the outcome model:

fit <- lm_weightit(Y_C ~ splines::ns(Ac, df = 4) *
(X1 + X2 + X3 + X4 + X5 +
X6 + X7 + X8 + X9),
data = d, weightit = W)

be modified as follows in order to convert the binary outcome (Y_B) into continuous as "predicted probabilities of outcome"?

fit <- glm_weightit(Y_B ~ splines::ns(Ac, df = 4) *
(X1+ X2 + X3 + X4 + X5 +
X6 + X7 + X8 + X9),
data = d, weightit = W, family = binomial)

Is the abovementioned modifications enough to continue with the rest of the analysis or my approach is wrong?

An error I also face when using the default "ind" way of dealing with missing data is that when I include the interaction term in my fitting mode, I get this error:

Warning: (from glm()) glm.fit: fitted probabilities numerically 0 or 1 occurred
Error in cbind(psi_out(Bout, w, Y, Xout, SW, offset), psi_treat(Btreat, :
number of rows of matrices must match (see arg 2)

This is also the case when i use a binary treatment variable. It seems that this error does not occur when i remove the interaction term along with the covariates.

Thank you in advance for your time and support.
I am genuinely looking forward to your response.
I would also like to apologize if any of my questions come across as overly basic or elementary.

Kind regards,
Kostas

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