Hello,
I am currently trying to impute missing variables in my sample. As we had significant interactions in the first model (when excluding missing observations), the smcfcs package seemed to suit our needs.
The model is a logistic regression, with the “user” variable (0/1) as the outcome.
I’m trying to run the smcfcs function :
smcfcs(dataset,"logistic",smformula="user~catage2+sexe+menage_tot+utilmarchescl+educrecod+MFR+acces_auto+Total_Meters+ratioUNH+perc_quartier_flcher+perc_quartier_FLqualite+perc_quartier_FLproximite+perc_quartier_FLchemin+FLcount+marche_itinerairehab+marche+utilmarchescl*marche+educrecod*marche+perc_quartier_FLqualite*marche", method=c("","","logreg","logreg","logreg","","norm","norm","logreg","","podds","","podds","podds","podds","podds","podds","mlogit","","","mlogit","utilmarchescl*marche","educrecod*marche","perc_quartier_FLqualite*marche"), predictorMatrix = predmatrix4, m = 5, numit = 10, rjlimit = 1000, noisy = FALSE)
The function seems to identify correctly the different types of variables, outcomes, passive, variables with missing values but I get an error and can’t get further:
[1] "Outcome variable(s): user"
[1] "Passive variables: int1,int2,int3"
[1] "Partially obs. variables: marche_itinerairehab,sexe,ne_canada,FLcount,menage_tot,MFR,utilmarchescl,perc_quartier_FLqualite,perc_quartier_FLproximite,perc_quartier_FLchemin,perc_quartier_flcher,catage2,educrecod,source_rev2"
[1] "Fully obs. substantive model variables: marche,acces_auto,Total_Meters,ratioUNH"
[1] "Imputation 1"
[1] "Imputing: marche_itinerairehab using marche,acces_auto,sexe,ne_canada,id_zone,FLcount,menage_tot,MFR,Total_Meters,utilmarchescl,perc_quartier_FLqualite,perc_quartier_FLproximite,perc_quartier_FLchemin,perc_quartier_flcher,catage2,educrecod,ratioUNH plus outcome"
Error in outcomeDensCovDens[, xMisVal] <- outcomeDens * fittedMean[imputationNeeded, :
incorrect number of subscripts on matrix
Can you
help me identify the reason for this error?
I can provide further information if necessary.
Many
thanks,
Pauline