search for: schoolid

Displaying 12 results from an estimated 12 matches for "schoolid".

2005 Dec 22
2
bVar slot of lmer objects and standard errors
.../content_storage_01/0000000b/80/2b/b3/94.pdf). Harold Doran mentioned (http://tolstoy.newcastle.edu.au/~rking/R/help/05/08/10638.html) that the posterior modes' variances can be found in the bVar slot of lmer objects. However, when I fit e.g. this model: lmertest1<-lmer(mathtot~1+(m_escs_c|schoolid),hlmframe) then lmertest1 at bVar$schoolid is a three-dimensional array with dimensions (2,2,28). The factor schoolid has 28 levels, and there are random effects for the intercept and m_escs_c, but what does the third dimension correspond to? In other words, what are the contents of bVar, and how...
2011 Feb 05
1
very basic HLM question
...ng a database of students, clustered on schools (there is not the same number of students by school). According to the ICC1 command, the interclass correlation is .44 > ICC1(anova1) [1] 0.4414491 However, I cannot get the same ICC from the lmer output: > anova2 <- lmer(math ~ 1 + (1|schoolid), data=nels88) > summary(anova2 <- lmer(math ~ 1 + (1|schoolid), data=nels88)) Linear mixed model fit by REML Formula: math ~ 1 + (1 | schoolid) Data: nels88 AIC BIC logLik deviance REMLdev 1878 1888 -935.8 1875 1872 Random effects: Groups Name Variance Std.Dev....
2006 Oct 20
1
Translating lme code into lmer was: Mixed effect model in R
...n the mlmRev package has repeated measures on students and those students are nested in schools. We can fit a model with random intercepts and slopes for students and students within schools. The first model is fit using lme and the second is fit using lmer. fm3 <- lme(math ~ year, random=~year|schoolid/childid, egsingle) fm4 <- lmer(math ~ year +(year|schoolid:childid) +(year|schoolid), egsingle, control=list(gradient = FALSE, niterEM = 0)) Both result in parameter estimates that are exactly the same. The newest release of lme4 allows for an even easier transition between lme and lmer. Model...
2006 Mar 29
1
Lmer BLUPS: was(lmer multilevel)
Paul: I may have found the issue (which is similar to your conclusion). I checked using egsingle in the mlmRev package as these individuals are strictly nested in this case: library(mlmRev) library(nlme) fm1 <- lme(math ~ year, random=~1|schoolid/childid, egsingle) fm2 <- lmer(math ~ year +(1|schoolid:childid) + (1|schoolid), egsingle) Checking the summary of both models, the output is exactly the same w.r.t. the fixed effects, variance components, standard errors etc. The prior two lines of code fit the same models. However, the follow...
2003 Sep 08
0
lmList with NAs
...iro and Bates (pg 33). I did not have a problem creating the graphic when I used the Orthodont data frame or 2 other data sets when there are no missing values. My data has missing values. Do I need to remove the missing values before the lmList function will work? for a small example: > a schoolid spring score childid 1 1 0 550 345 2 1 1 568 345 3 1 0 560 456 4 1 1 NA 456 5 2 0 540 32 6 2 1 562 32 7 2 0 579 34 8 2 1 599 34 > a1=groupedData(sc...
2003 Jun 25
2
NLME Covariates
...used at level 3, but not at the other levels. In HLM this is rather easy to do. However, how can one specify a covariate in R for only one of the levels? I have a sample data set with the structure as described above. I fit the unconditional model in R as model1<-lme(math~year, random=~year|schoolid/childid, data=datafile) Now, if I want to enter "female" as a covariate at level 2 only, how might I modify the code to accomplish this? ------ Harold C. Doran Director of Research and Evaluation New American Schools 675 N. Washington Street, Suite 220 Alexandria, Virginia 22314 703....
2004 May 28
0
Merging nlme output
Dear list: I am trying to merge two files together from output I get based on the coef() command. Here is what I am running into. I have two simple linear mixed models > mod1.lme<-lme(math~year, data=sample, random=~year|childid/schoolid) > mod2.lme<-lme(math~year, data=sample, random=~year|childid) I then call the coefficients and store them in the following objects using > mod1.coef<-coef(mod1.lme, level=2) > mod2.coef<-coef(mod2.lme) The problem is that the IDs are different for the two dataframes and I ca...
2004 Jul 02
1
Problem in lme4
Dear List: I was able to run the following in nlme successfully, but the same model and code (same dataset) failed to run in lme4 and gave me the error message below. Any thoughts? lme(math~year, data=egsingle, random=~year|schoolid/childid) Error in lme(formula = math ~ year, data = egsingle, random = structure(list( : Unable to invert singular factor of downdated X'X Harold [[alternative HTML version deleted]]
2011 Jun 01
1
How to write random effect in MCMCglmm
..., H, ..., - 7 levels) - ELL (num: 0, 1, - 2 levels) - Disability (num: 0, 1, - 2levels) - avgTransfers (num with missing values) - sdTransfers (num with missing values) - agec (num with missing values) - PctELL (num) - PctDisability (num) - PctMale (num) Random Effects: - Schoolid, Teacherid, Studentid library(MCMCglmm) y <- MCMCglmm(factor(Level) ~ Type+factor(yr>=2006)+Male+Ethnicity+ELL+ avgTransfers+sdTransfers+agec+Disability+ELL*pctELL+Disability*pctDisability+ pctMale+factor(yr>=2008)*factor(Grade), random=~Schoolid+Teacherid+Studentid,...
2011 Feb 07
2
Using Aggregate for Date
...:13 PM 335 20082009 4/15/09 1:53 PM 335 20082009 10/24/07 12:14 PM 126 20072008 11/7/07 12:21 PM 126 20072008 3/19/09 8:45 AM 177 20082009 4/2/09 8:54 AM 177 20082009 4/16/09 9:57 AM 177 20082009 day_min <- aggregate(mydata$date, by=list(mydata$schoolid, mydata$year), FUN=min) However, the result shows the date is in format as: "1193242974" instead of "mm/dd/yy HH:MM AM". Is there anyway that I can show original date in the result? Thanks -- View this message in context: http://r.789695.n4.nabble.com/Using-Aggregate-for-...
2003 Jul 08
2
NLME Fitted Values
...with the fitted values at different levels of a multilevel model. My data set is a series of student test scores over time with a total of 7,280 observations, 1,720 students nested witin 60 schools. The data set is not balanced. The model was fit using eg.model.1<-lme(math~year, random=~year|schoolid/childid, data=single). When I call the random effects at all levels using EB.1<-data.frame(ranef(eg.model1, level=1)) and EB.2<-data.frame(ranef(eg.model1, level=2)), I get the shrinkage estimators that I expect. That is, I get 2 random effects for each child (1 intercept and 1 slope) an...
2010 Oct 15
0
nomianl response model
...plain; charset=iso-8859-1 Dear All, ? I was trying to use the lmList function to get the lmList graphic but? have a problem creating the graphic.? My data has missing values and?an error occurred? as stated below. ################################################### library(nlme) > a ??schoolid spring score childid 1 1 0 550 345 2 1 1 568 345 3 1 0 560 456 4 1 1 NA 456 5 2 0 540 32 6 2 1 562 32 7 2 0 579 34 8 2 1 599 34 (lmlis1 <- lmList(score ~ childid | spring, data=a, na.action=T)) Error in UseMethod("getGroups") : no applicable method for "getGroups"...