search for: pddiag

Displaying 20 results from an estimated 43 matches for "pddiag".

2006 Aug 24
0
syntax for pdDiag (nlme)
At the top of page 283 of Pinheiro and Bates, a covariance structure for the indomethicin example is specified as random = pdDiag(A1 + lrc1 + A2 + lrc2 ~ 1) The argument to pdDiag() looks like a two-sided formula, and I'm struggling to reconcile this with the syntax described in Ch4 of the book and online. Further down page 283 the formula is translated into list(A1 ~ 1, lrc1 ~ 1, A2 ~ 1, lrc2 ~ 1) which I find just as...
2003 Nov 25
1
using pdMAT in the lme function?
...iagonal 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 and intercepts to zero. I try do do this using the pdDiag command as follows, but it does not work: > fit2<-lme(Ln.rgr~I(Ln.nar-log(0.0011)),data=meta.analysis, + random=pdDiag(diag(2),~1+I(Ln.nar-log(0.0011))|STUDY.CODE),na.action=na. omit) I get back an error saying that I have zero degrees of freedom. Clearly, the syntax of the command i...
2000 Jan 06
1
nlme
...tart=list(fixed=c(5,-2,-0.1)), fixed=list(p1+p2+p3~1),control=list(maxIter=100), groups=~subj,data=datam,verbose=T,method="ML") res2 <- 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),random=pdDiag(p1+p2+p3~1), groups=~subj,data=datam,verbose=T,method="ML") res3 <- 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,0)), fixed=list(p1+p2~1,p3~bilirubin),random=pdDiag(p1+p2+p3~1), groups=~subj,data=datam,verbose=T,m...
2004 Sep 02
0
syntex about a nested mixed linear model
...+ Array(Temp) + Dye*Array(Temp). For F tests of Dye and Dye*Temp, then denominator factor is Dye*Array(Temp). For F test of Temp, then denominator factor is Array(Temp). I wrote this syntax to fit the above model by typing: R2.0<-lme(dsnx.0 ~ temp+Dye+temp*Dye, random = list( Dye*Array(Temp)=pdDiag(~-1+temp*Dye), Arra=pdDiag(~-1+temp) ) ). But there is syntax error message. To obtain one solution, I typed >int.dye<-interaction(Dye,temp:Arra,drop=T) which created another factor, int.dye for 'Dye*Array(Temp)', and I typed: >R2.0<-lme(dsnx.0 ~ temp+Dye+temp*Dye, random =...
2010 Jul 11
1
How to automatically restart nlme in a user-defined function
...e estimation. The problem is sometimes nlme may not converge due to too many random effects. Say a, b are two parameters. if I specify random effects by: random = a+b~1, nlme fails to converge. Then I have to constrain the random effects in a positive definite diagonal matrix by: random = list(pdDiag(a+b~1)) My question is how I can restart nlme within my function. If random = a+b~1 fails, it won't quit and will go back to try random = list(pdDiag(a+b~1)) automatically. Currently I just have to do this manually. Thanks a lot. Jun Shen [[alternative HTML version deleted]]
2011 Mar 17
2
fitting gamm with interaction term
Hi all, I would like to fit a gamm model of the form: Y~X+X*f(z) Where f is the smooth function and With random effects on X and on the intercept. So, I try to write it like this: gam.lme<- gamm(Y~ s(z, by=X) +X, random=list(groups=pdDiag(~1+X)) ) but I get the error message : Error in MEestimate(lmeSt, grps) : Singularity in backsolve at level 0, block 1 When I simply fit a gam model using the formula above, then it works ok. Is it possible to fit such a model with gamm? Thanks a lot! [[alternative HT...
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
2010 Apr 14
3
pdMat
...zas 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 ejemplo ver una pdDiag, pero cuando abro una pdDiag veo un código tan sintético que me resulta imposible imarginar como armar algo a paritir de alli. Si hay algunos interesados en armar una librería de pdMat''s podría ser un buen proyecto grupal. Prof. Julio Di Rienzo Estadística y Biometría FCA- U.N. Córdoba...
2005 Sep 19
1
How to mimic pdMat of lme under lmer?
...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 using R version 2.1.0 for Linux and the most recent downloads of Matrix and nlme #dataset from McLean, Sanders and...
2007 Aug 23
0
Lost in substitute: nlsList and nlme with dynamic 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 a dynamic formula form = as.formula("conc~SSbiexp(time,A1,lrc1,A2,lrc2)") fm2Indom.lis = nlsList(form,data=Indometh) # still correct nlme(fm2Indom.lis,random=pdDiag(A1+lrc1+A2~1)) #Error in switch(mode(x), "NULL" = structure(NULL, class...
2010 Jan 04
1
glmer (lme4), glmmPQL (MASS) and xtmepoisson (Stata)
...e random effects in 'glmer' is unstructured, but this choice is absolutely unfeasible for this complex random effect nesting structure. Unfortunately, I couldn't find a way to input simpler correlation structures (namely diagonal or identity), in the same way as the using the functions pdDiag or pdIdent with 'glmmPQL'. I wonder if this option is still to be implemented in lme4. In this case, any suggestion/comment? Thanks for your time Antonio Gasparrini Public and Environmental Health Research Unit (PEHRU) London School of Hygiene & Tropical Medicine Keppel Street, Lon...
2006 Jul 03
1
analogue of group option of SAS MIXED/random in R
...ecifying Condition-specific heterogeneities in the variance-covariance parameters. I initially tried the following commands (without Condition-heterogeneity in the random effects): G.Data<-groupedData(Response~1|Subject,data=In.Data) Fit1<-lme(Response~1+Variable1+Variable2*Condition,random=pdDiag(~1+Variable1+Variable2),method="REML",data=G.Data) but have no idea about where to go from here (note that I don't want to nest Subject in Condition). Thanks!! Bruno
2007 Mar 13
0
segfault with correlation structures in nlme
...sed, but I was able to reproduce the error messages using the Ovary data set and the example in the Pinheiro & Bates book: >library(nlme) >data(ovary) >fm10var.lme <- lme(follicles ~ sin(2 * pi * Time) + cos(2 * pi * Time),data=Ovary, random=pdDiag(~sin(2*pi*Time))) >fm50var.lme <- update(fm10var.lme,correlation=corARMA(p=1,q=1)) >fm10var.nlme <- nlme(follicles ~ A + B * sin(2 * pi * w * Time) + C * cos(2 * pi * w * Time),data=Ovary, fixed= A+B+C+w~1, random=pdDiag...
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
2001 Dec 03
0
problems with nmle
Following the Indomethicin example in Pinheiro & Bates, chapter 6, page 277 etc, coming to the following comand: fm2Indom.nlme <- update( fm1Indom.nlme, random = pdDiag(A1 + lrc1 + A2 ~ 1) ) debugging nlme gives the following output: Browse[1]> n debug: modelResid <- ~eval(model, data.frame(data, getParsNlme(plist, fmap, rmapRel, bmap, groups, beta, bvec, b, level, N)))[naPat] Browse[1]> n debug: ww <- eval(modelExpression[[2]], envir = nlEnv) B...
2008 May 17
0
autocorrelation in nlme: Error: cannot allocate vector of size 220979 Kb
...ou may find the details of my model (lm11). I receive the error message "Error: cannot allocate vector of size 220979 Kb" after applying the autocorrelation function update(lm11, corr=corAR1()). lm11<-lme(Soil.temp ~ Veg*M+Veg*year, data=a, random = list(Site=pdDiag(~Veg), Plot=pdDiag(~Veg)) Dataset: a-data frame of daily measurements of soil temperature (Soil.temp) over six years Site (6 sites), Plot(2 plots per site), Veg(2 vegetation types: 2 sites as grassland, 4 sites as forest) M-month (categorical predictor) ye...
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), verbose=TRUE). Now, I want to include covariates (age and weight) in the base model. The relationships between CL and covariate is linear and...
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), length(x1), length(y0), length(y1)) : Argument "x0" is missing, with no default...
2006 Jan 11
1
F-test degree of freedoms in lme4 ?
...ical the analysis by BMDP 4V, except for the Greenhouse-Geisser epsilons, which are not estimated this way. I have to analyse a similar dataset, which is not balanced. So I need to change the method. Following Pinheiro/Bates p.90f, I tried > hf2.lme <- lme(ampl~gapf*bl,hframe2,random=list(VP=pdDiag(~gapf*bl),bl=pdDiag(~gapf))) and some variations of this to get the same F tests generated. At least, I got the F-test on error stratum VP:bl this way, but not the other two: >> anova(hf2.lme) > numDF denDF F-value p-value >(Intercept) 1 78 764.86 <.0001 >gapf...
2004 Sep 01
1
lme: howto specify covariance structure between levels of grouping factors
...f 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 'random=pdDiag(~effect)|group' but I would like to model the covariance structure' between' the different levels of the grouping factor. This is necessary because the plants (= grouping factor) we are testing are not independant. They are genetically correlated and usually we know this correlation...