similar to: How to automatically restart nlme in a user-defined function

Displaying 20 results from an estimated 20000 matches similar to: "How to automatically restart nlme in a user-defined function"

2010 Jul 12
1
What is the degrees of freedom in an nlme model
Dear all, I want to do a F test, which involves calculation of the degrees of freedom for the residuals. Now say, I have a nlme object "mod.nlme". I have two questions 1.How do I extract the degrees of freedom? 2.How is this degrees of freedom calculated in an nlme model? Thanks. Jun Shen Some sample code and data =================================================================
2000 Jan 06
1
nlme
Among others, datam contains the columns: logconc, tm, dose, subj, bilirubin. None of these are factor variables. The following compartment models work (the first still has not converged after 100 interations): res1 <- nlme(logconc~p2+p3+log(dose/(exp(p1)-exp(p2))* (exp(-exp(p2)*tm)-exp(-exp(p1)*tm))),start=list(fixed=c(5,-2,-0.1)), fixed=list(p1+p2+p3~1),control=list(maxIter=100),
2012 Feb 05
1
Covariate model in nlme
Dear R users, I am using nlme to fit a pharmacokinetic model. The base model is parameterized in terms of CL, V1, V2 and Q. basemodel<-nlme(Conc ~TwoCompModel(CL,Q,V1,V2,Time,ID), data = data2, fixed=list(CL+Q+V1+V2~1), random = pdDiag(CL+V1+V2~1), start=c(CL=log(20),Q=log(252),V1=log(24.9),V2=log(120)), control=list(returnObject=TRUE,msVerbose=TRUE, msMaxIter=20,pnlsMaxIter=20,pnlsTol=1),
2005 Jul 07
2
Problems with nlme: Quinidine example
This concerns the "Clinical Study of Quinidine" example on page 380 of the book "Mixed-Effects Models in S and S-PLUS" by Pinheiro and Bates (2000). I have tried to reproduce the example, but get an error: > library(nlme) > fm1Quin.nlme <- nlme(conc ~ quinModel(Subject, time, conc, dose, interval, lV, lKa, lCl), + data=Quinidine, +
2007 Jun 20
1
nlme correlated random effects
I am examining the following nlme model. asymporig<-function(x,th1,th2)th1*(1-exp(-exp(th2)*x)) mod1<-nlme(fa20~(ah*habdiv+ad*log(d)+ads*ds+ads2*ds2+at*trout)+asymporig(da.p,th1,th2), fixed=ah+ad+ads+ads2+at+th1+th2~1, random=th1+th2~1, start=c(ah=.9124,ad=.9252,ads=.5,ads2=-.1,at=-1,th1=2.842,th2=-6.917), data=pca1.grouped) However, the two random effects (th1 and th2)
2009 Aug 26
1
specify a model in differential equations (nlme)
Dear all, I wonder if there is a way to specify a model in differential equations for nlme(). Or in other packages? Appreciate any comment. Thanks. Jun Shen [[alternative HTML version deleted]]
2010 Apr 14
3
pdMat
Alguien tiene experiencia en escribir una pdMat. Para aquellos que no lo recuerden son las matrices de covarianzas de los efectos aleatorios que ajusta la función lme de la librería nlme Estas matrices tiene especial importancia en aplicaciones de genética de poblaciones y en particular en mapeo de asociación. Pinheiro y Bates dicen que el usuario puede crear sus propias pdMat y sugiere como
2007 Sep 27
1
Getting intervals for within-group standard errors for each group using nlme and varIdent
I am using lme from the nlme package to fit a mixed model. We have observations nested in patients(encounters) and patients nested in groups (2 different treatments). We are interested in the differences between the 2 groups, both the means and the standard deviations (are patients in group A less variable than those in group B? both within patient and between patient within group). Here is
2024 Jan 08
1
how to specify uncorrelated random effects in nlme::lme()
Dear professor, I'm using package nlme, but I can't find a way to specify two uncorrelated random effects. For example, a random intercept and a random slope. In package lme4, we can specify&nbsp;x + (x ll g) to realize, but how in nlme? Thanks! ???????????????????????? Zhen Wang Graduate student, Department of Medical Statistics, School of Public Health, Sun Yat-sen
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
2007 Mar 13
0
segfault with correlation structures in nlme
Hi out there, I am trying to fit a species accumulation curve (increase in number of species known vs. sampling effort) for multiple regions and several bootstrap samples. The bootstrap samples represent different arrangements of the actual sample sequence. I fitted a series of nlme-models and everything seems OK, but since the observations are correlated I tried to include some correlation
2007 Aug 23
0
Lost in substitute: nlsList and nlme with dynamic formula
DeaR I am trying to use a dynamically create formula with nlsList and nlme, but I cannot get the environment of the string-generated formal to work similarly to the manually entered one. Any idea? Dieter #----- library(nlme) # Pinheiro/Bates p 280 fm1Indom.lis = nlsList(conc~SSbiexp(time,A1,lrc1,A2,lrc2), data=Indometh) nlme(fm1Indom.lis,random=pdDiag(A1+lrc1+A2~1)) # works... # Simulating
2003 May 12
1
plot.ranef.lme (PR#2986)
library(nlme) data(Phenobarb) na.include <- function(x)x phe1 <- nlme(conc~phenoModel(Subject, time, dose, lCl, lV), data = Phenobarb, fixed = lCl+lV~1, random= pdDiag(lCl+lV~1), start = c(-5,0), na.action = na.include, naPattern = ~!is.na(conc)) phe.ranef <- ranef(phe1,augFrame=TRUE) plot(phe.ranef, form=lCl~Wt+ApgarInd) [Error in max(length(x0),
2010 Aug 05
1
Exporting nlme summary
I'm trying to export the results of my summary data for the object horton.nlme, but failing miserably. Running summary(horton.nlme) works fine, but both write.table and write.csv return the error "cannot coerce class 'c("summary.lme", "nlme", "lme")' into a data.frame". I know I can copy and paste the output from the summary function, but
2010 Mar 25
0
help with breaking loops used to fit covariates in nlme model building procedure
Dear All I'm attempting to speed up my model building procedure, but need some help with the loops I've created...please bear with me through the explanation! My basic model call is something like: m0sulf.nlme<-nlme(conc~beta0*exp(-beta1*day)+beta2*exp(-beta3*day), data=m0sulf, fixed=(beta0+beta1+beta2+beta3~1),
2005 Nov 09
1
strategies to obtain convergence using nlme
Hello. I am working on an analysis involving the nonlinear mixed model function (nlme) in R. The data consist of measures of carbon fixation by leaves as a function of light intensity and the parametric function (standard in this area because it has a biological interpretation) is a non-rectangular hyperbola. I cannot get the nonlinear mixed model (nlme) function to converge cleanly. I am
2003 Nov 25
1
using pdMAT in the lme function?
Hello. I want to specify a diagonal structure for the covariance matrix of random effects in the lme() function. Here is the call before I specify a diagonal structure: > fit2<-lme(Ln.rgr~I(Ln.nar-log(0.0011)),data=meta.analysis, + random=~1+I(Ln.nar-log(0.0011)|STUDY.CODE,na.action=na.omit) and this works fine. Now, I want to fix the covariance between the between-groups slopes
2004 Sep 01
1
lme: howto specify covariance structure between levels of grouping factors
Dear all, I am studying the possibility of using the nlme package in R to analyse field trials of agricultural crops. I have a problem with the syntax for the modelling of variance covariance structures. I can model the within-group covariance structure using the correlation argument and the covariance structure between different random effects of the same grouping level using
2006 Nov 20
1
My own correlation structure with nlme
Dear all, I am trying to define my own corStruct which is different from the classical one available in nlme. The structure of this correlation is given below. I am wondering to know how to continue with this structure by using specific functions (corMatrix, getCovariate, Initialize,...) in order to get a structure like corAR1, corSymm which will be working for my data. Thanks in advance.
2008 May 27
3
How to test significant differences for non-linear relationships for two locations
Hi List, I have to compare a relationship between y and x for two locations. I found logistic regression fits both datasets well, but I am not sure how to test if relationships for both sites are significantly different. I searched the r site, however no answers exactly match the question. I used Tukey's HSD to compare two means, but the relationship in my study was not simply linear. So I