Hi everyone,
I am working with a multi-level dataset of individuals nested in counties/localities/municipalities (I cannot post any example because of data privacy). I have read elsewhere that, ideally, I would need 5 level-1 (individuals) observations per each group/ level 2 (counties). Before I run the multilevel models, I try to accomplish this by typing :
bysort county_code: gen n=_N
keep if n>5
However, I am aware that this only removes rows based on the number of observations per county without considering whether there are missing values in the variables that I later use in my regressions. Since I am appending various individual surveys with different numbers of observations and variables, my multilevel models end up including level-2 units or groups with less than 5 observations ("min. observations per group = 1"), which, from what I understand, is not recommended.
How could I handle this issue without simply dropping rows, as I change both the dependent and independent variables across the models I run?
Thanks in advance,
I am working with a multi-level dataset of individuals nested in counties/localities/municipalities (I cannot post any example because of data privacy). I have read elsewhere that, ideally, I would need 5 level-1 (individuals) observations per each group/ level 2 (counties). Before I run the multilevel models, I try to accomplish this by typing :
bysort county_code: gen n=_N
keep if n>5
However, I am aware that this only removes rows based on the number of observations per county without considering whether there are missing values in the variables that I later use in my regressions. Since I am appending various individual surveys with different numbers of observations and variables, my multilevel models end up including level-2 units or groups with less than 5 observations ("min. observations per group = 1"), which, from what I understand, is not recommended.
How could I handle this issue without simply dropping rows, as I change both the dependent and independent variables across the models I run?
Thanks in advance,
Comment