0

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}

PKumar
  • 10,971
  • 6
  • 37
  • 52
Uswer721
  • 565
  • 1
  • 7
  • 13
  • Looks like v2.3 changed something around here "FIXED multinom MaxNWts type fix in polyreg and polr #9" https://github.com/stefvanbuuren/mice/releases – kaz_yos May 11 '17 at 22:17
  • The argument may have changed it's name to "nnet.MaxNWts". https://github.com/stefvanbuuren/mice/search?utf8=✓&q=MaxNWts&type – kaz_yos May 11 '17 at 22:32

1 Answers1

3

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

Gordon Li
  • 81
  • 1
  • 2