I want to analyze data from TIMSS on mathematics. Data contains two data sets one for student level information (i.e. level-1) and another one for school level information (i.e. level-2). Data sets are provided in two different files and each file contains school ID variable.
As far as I know, I can't do multilevel analysis with these two data sets and these have to be combined into one data set.Am I right?
I tried to use reshape
and reshape2
for combining the two data set but it didn't work. In level-1 data I have SchoolID,motivation, confidence, learningApproach and math scores. Data looks like:
SchoolID studentID motivation confidence learningApproach math
100123 10012301 23 10 12 45
100123 10012302 32 5 16 67
100123 10012303 14 7 21 89
.
.
.
110223 11023301 13 7 18 77
110223 11023302 24 7 11 98
110223 11023303 16 8 12 56
In level-2 data I have SchoolID and resources. Data looks like:
SchoolID resources
100123 45.5
100223 66.7
1106303 34
110223 22.3
Could you please guide me on how to combine these two data sets in an appropriate way for using with lme4
package?
Thanks.