I am writing a paper about public opinion. My dependent variable is individual-level, and is the answer to the question "Should the EU increase investment in cohesion policy?"
.
My independent variables are both individual-level (individual's Age
, individual's Gender
, individual's Education
, etc.) and country-level (EU member state's HDI
, EU member state's Religiosity
, etc.).
As I have multiple country-level data, I typically need to use a multilevel model to avoid ecological fallacy and other problems. My question is : how to do so in R?
I have few knowledge of this lme4 and I don't understand very well how the lmer function works. Could someone provide me with an accurate example using the variables above?
Many thanks!