问题
I am trying to impute categorical data through the mice package.
{qualiD = mice(quali,1, seed=123)}
And I get the following error:
{Error in nnet.default(X, Y, w, mask = mask, size = 0, skip = TRUE, softmax = TRUE, : too many (2184) weights}
I tried increasing the number of weights by including the MaxNWts param.
{qualiD = mice(quali,1, seed=123, MaxNWts = 3000)}
But then again i get this error:
{Error in nnet.default(X, Y, w, mask = mask, size = 0, skip = TRUE, softmax = TRUE, : formal argument "MaxNWts" matched by multiple actual arguments}
回答1:
Pass the argument using nnet.MaxNWts
qualiD = mice(quali,1, seed=123, nnet.MaxNWts = 3000)
This is described in the documentation of the mice imputation functions, e.g. mice.impute.polr
来源:https://stackoverflow.com/questions/43571859/how-to-set-maxnwts-value-in-r