I have cross-national panel data and I'd like to know the impact of IV
on a binary student-level outcome DV
I'd like to include a nested random effect that takes into account that which school the student is in will affect the outcome, and that schools are meaningfully different across countries: (1|country/school)
. So the model I started with is:
model = glmer(DV ~ IV + (1|country/school), data=data, family = 'binomial')
I'd also like to take into account temporal trends. At first I thought I should do year fixed effects, but the political developments of these countries vary significantly over time and I wanted to capture that while 1991 may have left schools in country A in turmoil, 1991 may have been a great year for educational funding in country B. I thus thought that I should possibly include a country-year fixed effect, as shown below:
model = glmer(DV ~ IV + (1|country/school) + as.factor(country_year),
data=data, family = 'binomial')
The random effects for the model are:
Random effects:
Groups Name Variance Std.Dev.
school:country (Intercept) 5.703e-02 2.388e-01
country (Intercept) 4.118e-15 6.417e-08
Number of obs: 627, groups: school:country, 51; country, 22
Is it incorrect to include country-year fixed effects, when there is already a country random effect included in the model?
An alternative way of asking the question:
How should I probably deal with the fact that school
is a subset of country
, and country_year
is a subset of country
, but neither school
or country_year
are subsets of each other?