search for: lme1

Displaying 20 results from an estimated 38 matches for "lme1".

Did you mean: lme
2006 May 06
2
How to test for significance of random effects?
...s provide a confidence interval for the between-group variance, but this is constructed so as to never include zero (I guess the interval is as narrow as possible on log scale, or something). I would be grateful if anyone could tell me how to test for zero variance between groups. If lm1 and lme1 are fitted with lm() and lme() respectively, then anova(lm1,lme1) gives an error, whereas anova(lme1,lm1) gives an answer which looks reasonable enough. The command logLik() can retrieve either restricted or ordinary log-likelihoods from a fitted model object, but the likelihoods are then...
2003 Jun 17
1
lme() vs aov(y ~ A*B + Error(aa %in% A + bb %in% B)) [repost]
I've posted the following to R-help on May 15. It has reproducible R code for real data -- and a real (academic, i.e unpaid) consultion background. I'd be glad for some insight here, mainly not for myself. In the mean time, we've learned that it is to be expected for anova(*, "marginal") to be contrast dependent, but still are glad for advice if you have experience. Thank
2009 Nov 03
1
lmer and estimable
...ghtly different place each time, based on a slightly different starting place. But this is only a guess - if anyone could either confirm or otherwise explain this unexpected-to-me happening, that'd be fantastic!! The code that I'm running is: design.1 = rbind(c(0,0,0,1,0,0,0,0,0,0,0,0)) lme1 <- lmer(var_x~AGE*GENDER*DAM_DIET + (1|CHIP) + (1|LITTER),x_temp) est <- estimable(lme1,design.1) print(est) est <- estimable(lme1,design.1) # Repeat of code print(est) est <- estimable(lme1,design.1) # Another repeat of code print(est) And this is the output - you can see in...
2008 Jan 28
0
(no subject)
...) for(case in 1:3){ if(case==1) c <- 1:3 if(case==2) c <- 5:15 if(case==3) c <- 25:150 for(r in(1:R)){ n <- c*m y <- rep(rnorm(m),each=c)+ rnorm(m*c) g <- as.factor(rep(1:m,each=c)) test <- data.frame(cbind(g,y)) #test$h <- 1:3 test.lme1 <- lme (y~1, test, random = ~1|g) #test.lme2 <- lme (y~1, test) glm <- glm(y~1) test.lm <- lm (y~1) glmm <- glmmPQL (y~1, test, random = ~1|g, family=gaussian) all.se.fix.coef.lm[r] <- as.vector(sqrt(vcov(test.lm))) all.fix.coef.lme [r] &l...
2005 Jul 18
1
Nested ANOVA with a random nested factor (how to use the lme function?)
...Df Sum Sq Mean Sq F value Pr(>F) Location 4 112366 28092 1.2742 0.2962 Location:Transect 5 121690 24338 1.1039 0.3736 Residuals 40 881875 22047 I have tried the following lme function to specify that Site is random: > lme1 <- lme(sp~Location, random=~1|Site, data=mavric) > lme2 <- lme(sp~Location, random=~1|Location/Site, data=mavric) > anova(lme1) numDF denDF F-value p-value (Intercept) 1 40 3.418077 0.0719 Location 4 5 1.152505 0.4294 This gives me the correc...
2006 Oct 08
2
latex and anova.lme problem
Dear R-helpers, When I try > anova(txtE2.lme, txtE2.lme1) Model df AIC BIC logLik Test L.Ratio p-value txtE2.lme 1 10 8590 8638 -4285 txtE2.lme1 2 7 8591 8624 -4288 1 vs 2 6.79 0.0789 > latex(anova(txtE2.lme, txtE2.lme1)) Error: object "n.group" not found I don't even see n.group as one of the arguments...
2011 Feb 03
0
Need advises on mixed-effect model ( a concrete example)
...re ? Thanks in advance for any help Sylvain Cl?ment University of Lille Nord de France ###################################### 1st APPROACH Using Mean RT of participants as my DV. ###################################### # first fit a model with single fixed effects of condition and groups result.lme1<-lme(RT~CONDITION+GROUP,data= meandata,random=~1|SUBJECT, method="ML") plot(effet.lme) # residuals are goodlooking #then I try to add an interaction term in the model result.lme2<-lme(RT~CONDITION*GROUP,data= meandata,random=~1|SUBJECT, method="ML") #I then compare bot...
2011 Mar 18
0
predict.nlme
...e to plot a mixed model analysis of covariance (ANCOVA). To do so I use the function predict in nlme but the line that is being drawn is totally out of control!!! here is my script (where MASS_S is dry mass and MASS_F is fresh mass): MEN<-read.table("Mentha_lme2.txt", h=T) attach(MEN) lme1<-lme(log(MASS_S)~log(MASS_F)*TREAT, random=~1|INDIV) summary(lme1) anova.lme(lme1) plot(log(MASS_F), log(MASS_S), type="n") points((log(MASS_F)[TREAT=="A"]), (log(MASS_S)[TREAT=="A"]), pch=16, col=1) points((log(MASS_F)[TREAT=="B"]), (log(MASS_S)[TREAT==&q...
2006 Jan 31
1
lme in R (WinXP) vs. Splus (HP UNIX)
...gives such different answers. My output makes me wonder if the fact that the UNIX box is 64 bits is the reason. The estimated random effects are identical, but the fixed effects are very different. Here is my R code and output, with some columns and rows deleted for space considerations: FOO.lme1 <- lme(fixed = Y ~ X1*X2, random = ~ X2 | X3, data = FOO, method = "REML", control = list(maxIter = 200, msMaxIter = 200, tolerance = 1e-8, niterEM = 200, msTol = 1e-8, msVerbose = TRUE, optimMethod = "Nelder-Mead")) 0 203.991: 0.924323 -0.0884338 0.493897 1...
2005 Sep 19
1
How to mimic pdMat of lme under lmer?
Dear members, I would like to switch from nlme to lme4 and try to translate some of my models that worked fine with lme. I have problems with the pdMat classes. Below a toy dataset with a fixed effect F and a random effect R. I gave also 2 similar lme models. The one containing pdLogChol (lme1) is easy to translate (as it is an explicit notation of the default model) The more parsimonious model with pdDiag replacing pdLogChol I cannot reproduce with lmer. The obvious choice for me would be my model lmer2, but this is yielding different result. Somebody any idea? Thanks, Joris I am u...
2008 Oct 15
2
Network meta-analysis, varConstPower in nlme
...ndirect treatment comparisons" (Statist Med, 2002) with great interest. I found it very helpful that you included the R code to replicate your analysis; however, I have had a problem replicating your example and wondered if you are able to give me a hint. When I use the code from the article: lme1 <- lme(Y1 ~ trt.B + trt.C + trt.D + trt.E, random = ~ 1 | trtpair, data=lumley1, var = varConstPower(form=~sigma, fixed=list(power=1))) I get an error message: Error in lme(Y1 ~ trt.B + trt.C + trt.D + trt.E, random = ~1 | trtpair, : unused argument(s) (var = list(const = numeric(0), power...
2005 Oct 28
2
Random effect models
...[1:3, 3] - tab1[c(3,3,4), 3]) / c(2*5, 2*10, 2), tab1[4,3]) > names(variances) <- c(names(Femp), "Residuelle") > variances Pollinisateur Lignee Interaction Residuelle 0.11866389 0.21818333 0.03389167 0.07590000 # Using lmer : > library(lme4) > lme1 <- lmer(Rendement ~ (1|Pollinisateur) + (1|Lignee) + (1|Pollinisateur:Lignee), data = mca2)) > summary(lme1) Linear mixed-effects model fit by REML Formula: Rendement ~ (1 | Pollinisateur) + (1 | Lignee) + (1 | Pollinisateur:Lignee) Data: mca2 AIC BIC logLik MLdeviance REM...
2008 Jul 30
1
Mixed effects model where nested factor is not the repeated across treatments lme???
...20 plots repeated down the next (block= 1 to 20) and records for metal volume (metal- 124 of these) I have made treatment and block a factor. But haven't grouped them (do I need to and how if so) The main question is in 3 parts: 1. is this the correct formula to use for this situation: lme1<-lme(metal~treatment,data=data,random=~1|block) (or is lme even the right thing to use here?) I get: > summary(lme1) Linear mixed-effects model fit by REML Data: data AIC BIC logLik 365.8327 382.5576 -176.9163 Random effects: Formula: ~1 | block (Int...
2004 Oct 08
1
Bug in nlme under version 2.0.0
Dear all, Under version 2.0.0, I get the error below when calling summary() on a lme-object, whereas it works under version 1.9.1 (well, it did last week, before I upgraded). Any help on this? Thx in advance S??ren > library(nlme) > mf <- formula(Weight~Cu*(Time+I(Time^2)+I(Time^3))) > lme1 <- lme(mf, data = dietox, random=~1|Pig) > summary(lme1) Linear mixed-effects model fit by REML Data: dietox AIC BIC logLik 4748.664 4815.081 -2360.332 Random effects: Formula: ~1 | Pig (Intercept) Residual StdDev: 6.360083 3.116751 Fixed effects: Error in as....
2005 May 09
1
bootstap and lme4
Hi, I am trying to get bootstrap confidence intervals on variance components and related statistics. To calculate the variance components I use the package lme4. > off.fun <- function(data, i){ d <- data[i,] lme1<- lmer(y ~ trt + (trt-1|group), d) VarCorr(lme1)@reSumry$group[2,1] #just as an example } > off.boot <- boot(data=data.sim, statistic=off.fun, R=100) If I choose small values of R (<10) then I get very reasonable results but for large R I get the following error massage: *...
2009 Aug 14
1
post hoc test after lme
Hi! I am quiet new with R and I have some problems to perform a posthoc test with an lme model. My model is the following: >lme1<-lme(eexp~meal+time, random=~1|id,na.action=na.omit) and then i try to get a post hoc test: >summary(glht(lme1,linfct=mcp(meal="Tukey))) but I get a warning message: Erreur dans as.vector(x, mode) : argument 'mode' incorrect Thank you for your help Guillaume -- View this me...
2005 Apr 05
1
nlme & SASmixed in 2.0.1
...associated packages. On trying library(SASmixed) data(PBIB) library(nlme) plot(PBIB) I get a warning message Warning message: replacing previous import: coef in: namespaceImportFrom(self, asNamespace(ns)) after library(nlme) and a "pairs" type plot of PBIB. Pressing on I get: > lme1 <- lme(response ~ Treatment, data=PBIB, random =~1| Block) > summary(lme1) Error: No slot of name "rep" for this object of class "lme" Error in deviance(object at rep, REML = REML) : Unable to find the argument "object" in selecting a method for functi...
2009 Apr 01
3
How to prevent inclusion of intercept in lme with interaction
...by=5), subject=subject,treat=c("contr","test")) grd$slope = varslope[grd$subject] + cslope[grd$treat] grd$newbone = grd$slope*grd$t+rnorm(nrow(grd),0,0.2) xyplot(newbone~t|treat,groups=subject,data=grd, type="l",xlim=c(0,20),ylim=c(0,3)) # With intercept grd.lme1 = lme(newbone~t*treat,data=grd,random=~1|subject) grd$pred1 = predict(grd.lme1,level=0) summary(grd.lme1) # How go force intercept = 0 ??? grd.lme0 = lme(newbone~t*treat-1,data=grd,random=~1|subject) grd$pred0 = predict(grd.lme0,level=0) summary(grd.lme0) # Gives true, all.equal(grd$pred1,grd$pred...
2004 Aug 11
1
Fwd: Enduring LME confusion… or Psychologists and Mixed-Effects
In my undertstanding of the problem, the model lme1 <- lme(resp~fact1*fact2, random=~1|subj) should be ok, providing that variances are homogenous both between & within subjects. The function will sort out which factors & interactions are to be compared within subjects, & which between subjects. The problem with df's arises (...
2007 Apr 11
0
Error with corCompSymm and lme fit for repeated measures
...7 F s4 1.0m july NA 67 7 F s4 2.5m july 10.27613353 68 7 F s4 5.0m july 8.00803252 69 7 F s4 0.5m august NA 70 7 F s4 1.0m august NA 71 7 F s4 2.5m august 10.27613353 72 7 F s4 5.0m august 7.34681883 > lme1 = lme(y ~ M*D*Time, random=~1|Block/M/D/Time, data=PhotoRed, na.action=na.omit) > lme2 = update(lme1, correlation=corAR1()) > lme3 = update(lme1, correlation=corCompSymm()) Error in corMatrix.corCompSymm(object) : NA/NaN/Inf in foreign function call (arg 1) > cs = corCompSymm(value=0.5,for...