anitalindmark / Study_Mediation_SES_Strokeoutcome_2023

Code to perform the analyses in "Mediation analyses of the mechanisms by which socioeconomic status, comorbidity, stroke severity, and acute care influence stroke outcome"
0 stars 0 forks source link

how to understand this code? #1

Closed hcyhh closed 1 day ago

hcyhh commented 1 month ago

data_for_imputations <- cbind(NIH_2cat=data_complcase$NIH_2cat,model_matrix_vars)

I find "data_complcase$NIH_2cat" and 'model_matrix_vars' have different rows. this warning can be accepted? i would appreciate if you can help me to fix this warning or give more information about data_orig THANKS!

anitalindmark commented 1 month ago

It is hard to say exactly what the issue is without more information on the data that you are using. But data_complcase and model_matrix_vars should have the same number of rows if you have removed the missing values on all the variables except NIH_2cat when creating data_complcase (i.e. all the variables that are on the right hand side of ~ in the formula of glm() when creating model_matrix_vars). I would check this first.

hcyhh commented 1 day ago

thank for your help, i already solve my question!