SMCFCS Error in R

30 views
Skip to first unread message

pauline.r...@ednh.fr

unread,
Mar 14, 2018, 4:36:24 AM3/14/18
to Missing Data

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

Jonathan Bartlett

unread,
Apr 10, 2018, 5:34:21 AM4/10/18
to Missing Data
Hi Pauline

It's difficult to know with only the R output unfortunately what the cause of the problem is. If you can send me the data, or reproduce the error on a dataset that you can send me, I can investigate further.

Best wishes
Jonathan
Reply all
Reply to author
Forward
0 new messages