search for: mathscores

Displaying 2 results from an estimated 2 matches for "mathscores".

2012 May 12
2
Why can we combine design matrix and data-frame in R?
..."MathAch", "MEANSES") head(MathAchieve) MathAchSchool <- read.table("mathachschool.txt") colnames(MathAchSchool) <- c("School", "Size", "Sector", "PRACAD", "DISCLIM", "HIMINTY", "MEANSES") MathScores <- merge(MathAchieve, MathAchSchool, by = "School") lm1 = lm(MathAch ~ SES + factor(Sector) , MathScores) X=model.matrix(MathAch ~ SES+factor(Sector) , MathScores) y=MathScores$MathAch tmp=MathScores tmp$y=y tmp$X=X lm1x = lm(y~X-1, tmp) plot(fitted(lm1), fitted(lm1x)) max(abs(...
2012 Jun 10
1
lmer function in R
Dear R users, I'm estimating a two-level regresion model but having difficuly in finding a good R syntax example. Let me use an example to explain what I'm doing. The dependent variable is math score (mathscore). Predictors are at two levels. At the student level, they are household income (hinc) and IQ (IQ). At the school level, there is a dummy variable indicating if the school is a