I've scoured Google and this site and I am still confused about the lmer function in the lme4 library.
I have some data collected from different psychiatric wards, which have a multilevel structure. To simplify, I'll pick two level 2 and two level 1 variables, although I actually have a few more.
Level 2- WardSize [this is the number of people on the ward] & WAS [this is a measure of how "nice" the ward is]
The grouping variable that tells R who's in which ward is called "Ward"
Level one- Gender [this is gender, obviously] & BSITotal [this is a measure of symptom severity]
Outcome is Selfreject, which again is what it sounds like.
I have this formula:
help=lmer(formula=Selfreject~WardSize+WAS+Gender+BSITotal+(1|Ward))
I'm hoping this means "each individual has a score related to their own Gender and symptom severity, and also a ward-level effect relating to the size of the ward and how "nice" it is"
Is this correct? The thing that's confusing me is that I can't see how R can tell which are level 1 and which level 2 variables, except for the ward level intercept given at the end.
If anyone could explain the notation so an idiot like me can understand that would be even better.
Many thanks!