similar to: lme and varFunc()

Displaying 20 results from an estimated 1000 matches similar to: "lme and varFunc()"

2005 Dec 27
2
glmmPQL and variance structure
Dear listers, glmmPQL (package MASS) is given to work by repeated call to lme. In the classical outputs glmmPQL the Variance Structure is given as " fixed weights, Formula: ~invwt". The script shows that the function varFixed() is used, though the place where 'invwt' is defined remains unclear to me. I wonder if there is an easy way to specify another variance
2009 Jul 30
3
What is the best method to produce means by categorical factors?
I am attempting to replicate some of my experience from SAS in R and assume there are best methods for using a combination of summary(), subset, and which() to produce a subset of mean values by categorical or ordinal factors. within sas I would write proc means mean data=dataset; class factor1 factor2 var variable1 variable2; RUN; producing an output with means for each variable by factor
2011 Sep 13
1
stupid lm() question
I feel bad even asking, but: Rgames> data(OrchardSprays) Rgames> model<-lm(decrease~.,data=OrchardSprays) Rgames> model Call: lm(formula = decrease ~ ., data = OrchardSprays) Coefficients: (Intercept) rowpos colpos treatmentB treatmentC 22.705 -2.784 -1.234 3.000 20.625 treatmentD treatmentE treatmentF treatmentG treatmentH
2007 Jun 10
1
{nlme} Multilevel estimation heteroscedasticity
Dear All, I'm trying to model heteroscedasticity using a multilevel model. To do so, I make use of the nlme package and the weigths-parameter. Let's say that I hypothesize that the exam score of students (normexam) is influenced by their score on a standardized LR test (standLRT). Students are of course nested in "schools". These variables are contained in the
2005 Feb 02
3
publishing random effects from lme
Dear all, Suppose I have a linear mixed-effects model (from the package nlme) with nested random effects (see below); how would I present the results from the random effects part in a publication? Specifically, I?d like to know: (1) What is the total variance of the random effects at each level? (2) How can I test the significance of the variance components? (3) Is there something like an
2005 Jul 26
1
evaluating variance functions in nlme
Hi, I guess this is a final plea, and maybe this should go to R-help but here goes. I am writing a set of functions for calibration and prediction, and to calculate standard errors and intervals I need the variance function to be evaluated at new prediction points. So for instance fit<-gnls(Y~SSlogis(foo,Asym,xmid,scal),weights=varPower())
2008 Apr 29
2
function to generate weights for lm?
Hi, I would like to use a weighted lm model to reduce heteroscendasticity. I am wondering if the only way to generate the weights in R is through the laborious process of trial and error by hand. Does anyone know if R has a function that would automatically generate the weights need for lm? Thanks, -- Tom [[alternative HTML version deleted]]
2009 Feb 24
1
Initialize varFunc in R
Hi, I am running R2.8.1 under Linux, and I am having trouble using the variance functions in nlme My basic model was something like: model0 <- lme( log(growth) ~ light * species.group , data=data, random=~light|species ) # with 20 odd species divided in 2 groups Following the methods in Pinheiro&Bates I tried to put a variance function in the model: model1 <- update(model0,
2006 Jan 09
1
trouble with extraction/interpretation of variance structure para meters from a model built using gnls and varConstPower
I have been using gnls with the weights argument (and varConstPower) to specify a variance structure for curve fits. In attempting to extract the parameters for the variance model I am seeing results I don't understand. When I simply display the model (or use "summary" on the model), I get what seem like reasonable values for both "power" and "const". When I
2008 May 09
1
Which gls models to use?
Hi, I need to correct for ar(1) behavior of my residuals of my model. I noticed that there are multiple gls models in R. I am wondering if anyone has experience in choosing between gls models. For example, how should one decide whether to use lm.gls in MASS, or gls in nlme for correcting ar(1)? Does anyone have a preference? Any advice is appreciated! Thanks, -- Tom [[alternative HTML
2004 Oct 03
1
creating new varFunc classes in nlme .. error: "Don't know how to get coefficients for .. object"
Hello. I am trying my hand at modifying the varFunc class varExp, but I must be missing a step. All I want to do right now is make a working copy of varExp, call it varExp2, and then later change it. coef.varExp2, coef<-.varExp2, and Initialize.varExp2 all seem to work properly after I construct them. I can successfully use the commands: v2 <- varExp2(form = ~age|Sex,fixed =
2012 Aug 07
1
Which R function for GLMM with binary response, nested random factors with temporal correlation?
Despite lots of investigation, I haven't found any R packages might be suitable for the following problem. I'd be very grateful for suggestions. I have three-way nested data, with a series of measures (obs) taken in quick succession (equal time spacing) from each subject on different days. The measures taken on the same day are temporally correlated, so I'd like to use an AR1
2012 Mar 21
1
nlme error on dimensions in multiplication
Hello R users, When trying to fit a nonlinear mixed model to a respiration time series, I get the following error message: Error in recalc.varFunc(object[[i]], conLin) : dims [product 30] do not match the length of object [34] In addition: Warning message: In conLin$Xy * varWeights(object) : longer object length is not a multiple of shorter object length Below is an example that generates
2009 Jan 07
1
Extracting degrees of freedom from a gnls object
Dear all, How can I extract the total and residual d.f. from a gnls object? I have tried str(summary(gnls.model)) and str(gnls.model) as well as gnls(), but couldn?t find the entry in the resulting lists. Many thanks! Best wishes Christoph -- Dr. rer.nat. Christoph Scherber University of Goettingen DNPW, Agroecology Waldweg 26 D-37073 Goettingen Germany phone +49 (0)551 39 8807 fax +49
2008 Aug 22
1
lme questions re: repeated measures & covariance structure
Hello, We are attempting to use nlme to fit a linear mixed model to explain bird abundance as a function of habitat: lme(abundance~habitat-1,data=data,method="ML",random=~1|sampleunit) The data consist of repeated counts of birds in sample units across multiple years, and we have two questions: 1) Is it necessary (and, if so, how) to specify the repeated measure (years)? As written,
2008 Jan 24
2
testing coeficients of glm
Dear list, i'm trying to test if a linear combination of coefficients of glm is equal to 0. For example : class 'cl' has 3 levels (1,2,3) and 'y' is a response variable. We want to test H0: mu1 + mu2 - mu3 =0 where mu1,mu2, and mu3 are the means for each level. for me, the question is how to get the covariance matrix of the estimated parameters from glm. but perhaps there
2004 Oct 01
4
gnls or nlme : how to obtain confidence intervals of fitted values
Hi I use gnls to fit non linear models of the form y = alpha * x**beta (alpha and beta being linear functions of a 2nd regressor z i.e. alpha=a1+a2*z and beta=b1+b2*z) with variance function varPower(fitted(.)) which sounds correct for the data set I use. My purpose is to use the fitted models for predictions with other sets of regressors x, z than those used in fitting. I therefore need to
2004 Mar 04
1
binomial errors in split-plot design
Dear all, I have proportion data with binomial errors. The problem is that the whole experiment was laid out as a split-plot design. Ideally, what I would like is having a glm with an Error term such as glm(y~x+Error(A/B)) but I fear this is not possible. Would using lme be an alternative? How could I state the variance structure, then? I would very much appreciate any suggestions! Best
2005 Mar 09
0
need help getting started writing a new varFunc class for lme()
Hello - I've been using R for years, but have always been able to find what I need already available. Now I find that I would like to write a new varFunc class for the lme() or nlme() packages. There is some guidance for this in Problem 4 Chapter 5 of Bates and Pinheiro Mixed Effects Models in S and S-Plus. However, I find that I am unable to even get started and so have just purchased
2011 Jun 28
2
gam confidence interval (package mgcv)
Dear R-helpers, I am trying to construct a confidence interval on a prediction of a gam fit. I have the Wood (2006) book, and section 5.2.7 seems relevant but I am not able to apply that to this, different, problem. Any help is appreciated! Basically I have a function Y = f(X) for two different treatments A and B. I am interested in the treatment ratios : Y(treatment = B) / Y(treatment = A) as