search for: lmecontrol

Displaying 20 results from an estimated 39 matches for "lmecontrol".

2006 Jul 23
3
Making a patch
Dear R developers, is there a preferred format or strategy for making a patch to contribute to a package that is maintained by R-core? Berwin Turlach and I have written a very minor extension to lmeControl to allow it to pass an argument to nlminb for the maximum number of evaluations of the objective function. I've edited the nlme/R/lme.R and nlme/man/lmeControl.Rd files. I can diff the files, but the options seem numerous. I haven't been able to find any hinst on the preferred approach....
2009 Jan 22
1
convergence problem gamm / lme
...(k < M + 1) { : the condition has length > 1 and only the first element will be used .Options$mgcv.vc.logrange=0.001 # we also tried higher settings > gamm3<-gamm(count~offset(offsetter)+s(lon,lat),random=list(code_tripnr=~1),family="poisson", niterPQL=200, control=lmeControl(opt="optim")) Maximum number of PQL iterations: 200 iteration 1 iteration 2 Error in optim(c(coef(lmeSt)), function(lmePars) -logLik(lmeSt, lmePars), : initial value in 'vmmin' is not finite gamm3<-gamm(count~offset(offsetter)+s(lon,lat),random=list(code_tripnr...
2005 Sep 29
2
how to fix the level-1 variances in lme()?
Dear all, Edmond Ng (http://multilevel.ioe.ac.uk/softrev/reviewsplus.pdf) provides an example to fit the mixed effects meta-analysis in Splus 6.2. The syntax is: lme(fixed=d~wks, data=meta, random=~1|study, weights=varFixed(~Vofd), control=lmeControl(sigma=1)) where d is the effect size, study is the study number, Vofd is the variance of the effect size and meta is the data frame. "sigma=1" is required to constrain the level 1 variance in applying mixed-effects models in meta-analysis. In Splus 6.1, I found that the help manual of...
2006 Jun 28
3
lme convergence
Dear R-Users, Is it possible to get the covariance matrix from an lme model that did not converge ? I am doing a simulation which entails fitting linear mixed models, using a "for loop". Within each loop, i generate a new data set and analyze it using a mixed model. The loop stops When the "lme function" does not converge for a simulated dataset. I want to
2006 May 26
2
lme, best model without convergence
...mixed models with the lme function of the nlme package. If I get convergence depends on how the method (ML/REM) and which (and how much) parameters will depend randomly on the cluster-variable. How get the bist fit without convergence? I set the parameters msVerbose and returnObject to TRUE: lmeControl(maxIter=50000, msMaxIter=200, tolerance=1e-4, niter=50, msTol=1e-5, nlmStepMax=500, ,msVerbose=TRUE ,returnObject=TRUE ) However, the lme-functions does not produce verbose output, nor does it return the best fit if lme is not converging. It returns only an error: Error in lme.formula(y ~ ln...
2009 Feb 12
1
Setting optimizer in lme
...ed in the example that I am studying. Help file indicates that "opt the optimizer to be used, either nlminb (the default since (R 2.2.0) or optim (the previous default)." So tried to go back the old optimize that used in the 2002 example, but I do not seem to be able to get there. lmeControl(opt=optim) Error in match.arg(opt) : 'arg' must be NULL or a character vector R> lmeControl(opt="optim") $maxIter [1] 50 ... $opt [1] "optim" ... R> lme(log.exercise ~ I(age - 8)*group, + random = ~ I(age - 8) | subject, +...
2009 Apr 29
1
meta regression in R using lme function
...ing the lme function. The reason for doing this with lme function is that we have covariates and studies within references. In S-Plus this is possible by using the following command: lme(outcome ~ covars, random = ~1 | reference/study, weights = varFixed(~var.outcome), data = mydata, control = lmeControl(sigma = 1)) This means that the residual variance is equal to var.outcome times sigma, where sigma is fixed to 1. In R we do not know how to fix sigma = 1 in the lmeControl. Has anyone experience with this? If so, how can we solve this problem? We can't stand that we can do it in S-Plus, b...
2005 Mar 01
3
packages masking other objects
...oad both packages I get the following message and the getCovariateFormula function no longer works: library(nlme) library(lme4) Attaching package 'lme4': The following object(s) are masked from package:nlme : contr.SAS getCovariateFormula getResponseFormula groupedData lmeControl I have tried removing the package after using it, with: detach(package:lme4) library(nlme) but I still get an error message when I try to use getCovariateFormula. The line I use it in, and the error message is below: rownames(table)<-c((getCovariateFormula(model1)),(getCovariateFormula(model...
2008 Jun 14
1
"False convergence" in LME
I tried to use LME (on a fairly large dataset, so I am not including it), and I got this error message: Error in lme.formula(formula(paste(c(toString(TargetName), "as.factor(nodeInd)"), : nlminb problem, convergence error code = 1 message = false convergence (8) Is there any way to get more information or to get the potentially wrong estimates from LME? (Also, the page in the
2017 Aug 09
3
Plotting log transformed predicted values from lme
...variable, and two nested random intercept terms. I want to save the predicted values from that model and show the log curve in a plot ; predicted~log(x) mod<-lme(B~log(x)+as.factor(y), random=~1|cohort/Study, weights=varFixed(~I(SE^2)), na.action=na.omit, data=subset(meta), control = lmeControl(sigma = 1, apVar = FALSE)) summary(mod) newdat <- data.frame(x=seq(min(meta$x), max(meta$x),,118)) # I have 118 observations. #How do I add the factor variable to my newdat? newdat$pred <- predict(mod, newdat,level = 0,type="response") plot(B ~ x, data=meta) lines(B ~ x, data=new...
2004 Nov 30
1
lme in R-2.0.0: Problem with lmeControl
Hello! One note/question hier about specification of control-parameters in the lme(...,control=list(...)) function call: i tried to specify tne number of iteration needed via lme(....,control=list(maxIter=..., niterEM=...,msVerbose=TRUE)) but every time i change the defualt values maxIter (e.g. maxIter=1, niterEM=0) on ones specified by me, the call returns all the iterations needed until
2013 Oct 26
2
Problems with lme random slope+intercept model
...lure. m3.lme<-with(data,lme(y~x1+x2+x3+factor,random=reStruct(object=~1+y|id,pdClass="pdDiag"),na.action=na.omit)) #Error in lme.formula(y ~ x1 + x2 + x3, random = reStruct(object = ~y | : #nlminb problem, convergence error code = 1 #message = false convergence (8) However, changing lmeControl gets this model to run, but I can't make sense of the estimates for fixed effects, suggesting the model might be biased. In addition, I'm not sure how changing lmeControl changes model interpretation. Perhaps someone could fill me in on this? m4.lme<-with(data,lme(y~x1+x2+x3+factor,rand...
2013 Jan 23
1
mixed effects meta-regression: nlme vs. metafor
...;lme()" will fit an additional variance parameter scaling the provided standard errors by a certain factor to be estimated. According to some discussions on the web, you once were able to prevent the fitting of the extra variance parameter in some pre-1998 S-plus versions of nlme using a "lmeControl(sigma=1)" option, but this does not appear to available any more. I again get /almost/ what I want using the "metafor" package: rma01 <- rma(yi = effect, vi = se2, mods = ~ treatment + treatment*time - time - 1, data = dat) "r...
2007 Feb 28
1
LME without convergence
...del1<-lme(dep~yes,random=yes|treat) R encounters the following problem: Fehler in lme.formula(dep ~ yes, random = ~yes | treat) : iteration limit reached without convergence (9) Following other instructions on that problem, I tried to adjust the iteration limits and tolerances using lmeControl(), however this did not work. Can someone help me? Best regards, Ralf
2007 Nov 01
1
A question about lme object
I have a question about the lme function in R. My question is: After I got the object from function lme, why the numIter value of the object is always NULL? Following is my code: jjww<-lme(y~x*zz,data=simul,random=~x|group, control=lmeControl(returnObject=TRUE)) attributes(jjww) jjww$numIter the first 20 observation of data simul are: > simul y x zz group 1 1.20722846 0.173024384 0.13729258 1 2 1.44590474 -0.811427991 0.13729258 1 3 0.18967259 -1.08905...
2007 Dec 05
0
lme output
Dear all, I noticed the following in the call of lme using msVerbose. fm1 <- lme(distance ~ age, data = Orthodont, control = lmeControl(msVerbose=T)) 9 318.073: -0.567886 0.152479 1.98021 10 318.073: -0.567191 0.152472 1.98009 11 318.073: -0.567208 0.152473 1.98010 fm2 <- lme(distance ~ age, random =~age, data = Orthodont, lmeControl(msVerbose=T)) 7 318.073: -0.342484 1.75530 4.4...
2001 Dec 05
1
how to obtain EM-estimates of cov(b) and var(e) from lme
...ts model for m subjects: y = b0 + b1 x + r0 + r1 x + e where b0 and b1 are fixed parameters, r0 and r1 are random, e ~ N(0,s2 I) and R' = [r0, r1] ~ N(0,T). I try to obtain the EM-estimates of s2 and the elements of T by lme(y~x,data=mydata,random= list(group=~x), control=lmeControl(maxIter = 0, niterEM=100,msVerbose = TRUE)) Does this statement do the job? Thank you very much. Cheers! Han-Lin Lai, Ph.D Han-Lin.Lai at noaa.gov 508-495-2312 -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.a...
2012 Feb 07
1
lme, lmer, convergence
...ild a failsafe into my program so that if a particular model in an iteration doesn't converge, I call a redo on that iteration. This way the program will keep running and not stop in a fit of pique in the middle of my long simulation. If I can't do this, my fallback will be to try setting lmeControl options such that even "bad" models return parameter estimates etc -- once or twice in 10,000 iterations should not ruin things too badly -- but I'd like to try it the cleaner way first. Erin Jonaitis, Ph.D. Assistant Scientist, Wisconsin Alzheimer's Institute 7818 Big Sky Drive...
2017 Aug 10
0
Plotting log transformed predicted values from lme
...ntercept terms. > > I want to save the predicted values from that model and show the log curve > in a plot ; predicted~log(x) > > mod<-lme(B~log(x)+as.factor(y), random=~1|cohort/Study, > weights=varFixed(~I(SE^2)), na.action=na.omit, data=subset(meta), > control = lmeControl(sigma = 1, apVar = FALSE)) > summary(mod) > > newdat <- data.frame(x=seq(min(meta$x), max(meta$x),,118)) # I have 118 > observations. #How do I add the factor variable to my newdat? > newdat$pred <- predict(mod, newdat,level = 0,type="response") > > plot(B ~ x,...
2011 Jun 22
1
lme convergence failure within a loop
...c mixed model structure may not be the best fit for every cell. I expect the optimization to fail in some places. I want to be able to detect when the algorithm has failed to converge automatically, so that I can continue my loop and record the places where the model does fit. I've used the lmeControl method with returnObject=TRUE options to allow me to continue looping, however I want to be able to flag the places where the convergence failed so that I can reject these gridcells and not mistakenly claim that the model fits at these points. Is there a way to do this? My example code shows t...