NErler / JointAI

Joint Analysis and Imputation of generalized linear models and linear mixed models with missing values
https://nerler.github.io/JointAI
28 stars 4 forks source link

It is currently not possible to use “contr.poly” for incomplete categorical covariates. I will use “contr.treatment” instead. You can specify (globally) which types of contrasts are used by changing “options('contrasts')”. #4

Closed bbb801 closed 2 years ago

bbb801 commented 2 years ago

Dear Dr Nicole Erler

My whole data has over 30,0000 and 884 columns. Now I just sample 1000 rows for testing using using 'survreg_imp' function. Then it has been running for a whole day and never stops, just with 1000 rows data; I also see the warning: Warning: It is currently not possible to use “contr.poly” for incomplete categorical covariates. I will use “contr.treatment” instead. You can specify (globally) which types of contrasts are used by changing “options('contrasts')”.

Here shows the codes:

d<-d[sample(nrow(d), 1000), ] f<-as.formula(paste('Surv(survival_time,', i,')~',paste(names(d)[!names(d) %in% label_used],collapse='+'))) mod1 <- survreg_imp(f,data = d[!names(d) %in% label_used], n.iter = 250,shrinkage = 'ridge',seed=1,monitor_params = c(analysis_main=TRUE,other_models = TRUE, imps = TRUE)) image

Could you provide some suggestions?

NErler commented 2 years ago

How many covariates do you have in the model and how many are incomplete?