vahidnassiri / mifa

Multiple Imputation for Exploratory Factor Analysis
Other
0 stars 0 forks source link

perform imputation using additional predictor variables #3

Open Teebusch opened 5 years ago

Teebusch commented 5 years ago

Would it be sensible to allow to specify in mifa.cov() additional predictors to be used for the imputations of the response variables, but not the calculations of the covariance matrix?

As an example:

The predictors will likely improve imputation of the response variables, but of course I only want to calculate covariances for the response variables. (calculating covariances for predictors might fail if they are categorical)

possible implementation

It should be possible to specify variables to remove from the imputed data, i.e. in mia.cov() after comp.mice[[i]] has been calculated. The to-be-removed variables could be specified as an additional argument to mifa.cov() that takes a vector of column names, column numbers or a binary mask.

something like this should do the job:

for (i in 1:M) {
  tmp = comp.mice[[i]]
  comp.mice[[i]] = tmp[, !names(tmp) %in% cols.ignore.fa]
 # where cols.ignore.fa is a character vector with th names of the to-be-ignored columns
} 

I'd be happy to code this up and make a pull request for it, but I wonder if here is anything that speaks against this, from a theoretical standpoint?

alovik commented 4 years ago

No, I do not think so. The imputation and the EFA steps are quite independent.

Also, an option to include categorical variables would be to use correlations (e.g. polychoric, Spearman, etc.) instead of covariances. This is also relevant when the continuous response variables are not measured on the same scale.