Page 1 of 1

r2mlwin output shows wrong number of higher levels, when subseiting the dataframe

Posted: Wed Sep 30, 2015 6:44 pm
by adeldaoud
Hi

This is not a serious issue but can be confusing. R2mlwin output shows the wrong number of higher level units, when subsetting the dataframe and the higher level identifier is a factor. This is due to the fact that R keeps factor names even if they are unused. This means that one should use the droplevels() function after subsetting and before using the variable in an estimation.

https://stat.ethz.ch/R-manual/R-devel/l ... evels.html

I assume that this could be a relatively easy implementation into the R2mlwin function itself: namely to drop any unused factor levels.

cheers
Adel

Re: r2mlwin output shows wrong number of higher levels, when subseiting the dataframe

Posted: Thu Oct 01, 2015 2:24 pm
by ChrisCharlton
Thanks for pointing this out. This should now be fixed in the development version (if for some reason you want the old behaviour set the estimation option drop.levels to FALSE).