r2mlwin output shows wrong number of higher levels, when subseiting the dataframe
Posted: Wed Sep 30, 2015 6:44 pm
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
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