Adding imputation function in mice - r

I recently fitted a Graded Response Model to my data using R's latent trait modelling package. I tried to add my fitted Graded response model in mice package to impute missing data but i am failing to access the mice algorithm to edit. My question is does it make any difference if i use the polr() function in mice or if i use my graded response model that i fitted using latent trait modelling package to impute data since both these functions are derived from polr() function in R's mass package

Related

knn imputation for mixed data in glmnet during cross-validation without information leakage

I would like to use glmnet and impute missing data with knn imputation method which is based on the Gower Distance for numerical, categorical, ordered and semi-continuous variables (not possible with caret's knn imputation method). In order to assess the model adequately, I need to use the imputation model of the training data to impute missing data in the test data during cross-validation. I assume it should be possible to do this using the makeX function in glmnet and replace the mean imputation with a different imputation method. Does anyone know how to do this or have any other idea?

flexmix package in R LCA

I want to conduct LCA to predict latent class membership through GAM(generalized additive model)
but I can't find method to handle two or more categorical indicator variable in flexmix package.
I want to use one step method, not three step.
Is it impossible to conduct LCA in flexmix package? not poLCA

Does glmnet package support multivariate grouped lasso regression?

I'm trying to perform a multivariate lasso regression on a dataset with 300 independent variables and 11 response variables using glmnet library. I'd like to group some of the input variables and then apply multivariate grouped lasso regression so that all the grouped variables are either selected or discarded by the lasso model depending on their significance. How can I achieve this? I did look into grplasso package but it doesn't support multivariate regression.
I assume you mean multinomial regression as you have a multiclass problem (11 classes). In addition, you want to apply group lasso. My recommendation is to use msgl package because it supports group lasso, sparse group lasso and the regular lasso as well. This can be done by supplying the alpha parameter
Alpha : the α value 0 for group lasso, 1 for lasso, between 0 and 1
gives a sparse group lasso penalty.
You can use it for binary classification or multiclass classification as in your problem. You may also tune your lambda using cross-validation using the same package. The documentation is pretty clear and there is also a nice get started page with an example of how to group your variables and perform your analysis. According to my personal experience with this package, it is incredibly fast but it is not as friendly as glmnet package.
One more thing, the package depends on another prerequisite package that needs to be installed as well which is sglOptim

LDA model on weighted data - R

I would like to use linear discriminant analysis model (lda) on my weighted data. In my data set, I have one column with weights which are not integers (I cant just replicate rows). lda function from MASS package does not allow me to use vector of weights for observations. Do you know, how deal with it ? I have tried also with mlr package but learner classif.lda still uses lda implementation from MASS package, so I get error:
Error in checkLearnerBeforeTrain(task, learner, weights) :
Weights vector passed to train, but learner 'classif.lda' does not support that!
Do you know how to solve this problem ?

Assigning prior weights/preferences to predictor variables for regression tree analysis

Within R's "rpart" package for classification/regression trees, is it possible to specify prior weights for the predictor variables? Alternatively, is this a possibility with the BART (Bayesian Additive Regression Trees) package, random forests, or any other package in R?
Based on expert opinion, I would like to force certain predictor variables to be included. Thanks

Resources