similar to: lme: how to extract the variance components?

Displaying 20 results from an estimated 700 matches similar to: "lme: how to extract the variance components?"

2001 Oct 09
1
PROC MIXED user trying to use (n)lme...
Dear R-users Coming from a proc mixed (SAS) background I am trying to get into the use of (n)lme. In this connection, I have some (presumably stupid) questions which I am sure someone out there can answer: 1) With proc mixed it is easy to get a hold on the estimated variance parameters as they can be put out into a SAS data set. How do I do the same with lme-objects? For example, I can see the
2005 Jun 28
1
How to extract the within group correlation structure matrix in "lme"
Dear R users, I fitted a repeated measure model without random effects by using lme. I will use the estimates from that model as an initial estimates to do multiple imputation for missing values of the response variable in the model. I am trying to extract the within group correlation matrix or covariance matrix. here is my code: f = lme(y ~x0+x1+trt+tim+x1:tim +tim:trt,random=~-1|subj,
2007 Jan 02
1
How to extract the variance componets from lme
Here is a piece of code fitting a model to a (part) of a dataset, just for illustration. I can extract the random interaction and the residual variance in group meth==1 using VarCorr, but how do I get the other residual variance? Is there any way to get the other variances in numerical form directly - it seems a litte contraintuitive to use "as.numeric" when extracting estimates,
2003 May 20
1
Extracting elements from an reStruct
Sorry if this is obvious, but my S skills aren't great and I haven't been able to find it documented anywhere. I want to write a new function for use with lme objects; the function will simply calculate an ICC (aka "rho") for each level of a mixed-effects model. What I need for this is pretty simple: (c(var1..varn, residual)) / sum(c(var1..varn, residual)) where var1..varn
2003 Mar 04
2
How to extract R{i} from lme object?
Hi, lme() users, Can some one tell me how to do this. I model Orthodont with the same G for random variables, but different R{i}'s for boys and girls, so that I can get sigma1_square_hat for boys and sigma2_square_hat for girls. The model is Y{i}=X{i}beta + Z{i}b + e{i} b ~ iid N(0,G) and e{i} ~ iid N(0,R{i}) i=1,2 orth.lme <- lme(distance ~ Sex * age, data=Orthodont, random=~age|Subject,
1999 Jun 07
1
Re:
move or copy the directories mass, nnet and class to the library directory - then execute link.html.help() Now execute library(MASS) and data(petrol) Should work. "Troels Ring"
2006 Jun 01
2
Help: lme
Good day R-Users, I have a problem accessing some values in the output from the summary of an lme fit. The structure of my data is as shown below (I have attached a copy of the full data). id trials endp Z.sas ST 1 1 -1 -1 42.42884 1 1 1 -1 48.12007 2 1 -1 -1 43.42878 2 1 1 -1
2011 Dec 08
1
partial duplicates of dataframe rows, indexing and removal
Hello. I am trying to remove from my dataframe, those rows in which the first 7 columns are duplicated even if subsequent columns make those rows unique. df<-data.frame(id=rep(c('amy','bob','joe') , each=5), pet1=sample(LETTERS[1:3],15, replace=T), pet2=sample(LETTERS[1:3],15, replace=T), pet3=sample(LETTERS[1:5],15, replace=T)) >df id pet1 pet2
2004 Apr 05
3
2 lme questions
Greetings, 1) Is there a nice way of extracting the variance estimates from an lme fit? They don't seem to be part of the lme object. 2) In a series of simulations, I am finding that with ML fitting one of my random effect variances is sometimes being estimated as essentially zero with massive CI instead of the finite value it should have, whilst using REML I get the expected value. I guess
2007 May 03
2
Package contrast error
Trying to use contrast to look at differences within an lme lme.fnl.REML <- lme(Max ~ S + Tr + Yr + Tr:Yr, random = ~1 |TID, method = "REML") I have three levels of Tr I'm trying to contrast among different years (R, T97, T98), years = 1997-1999, so I'm interested in contrasts of the interaction term. > anova(lme.fnl.REML) numDF denDF F-value
2006 May 30
1
Query: lme output
Dear R-Users I have a problem accessing some values in the output from the summary of an lme fit. I fit the model below: ggg <- lme (ST~ -1 + as.factor(endp):Z.sas + as.factor(endp), data=dat4a, random=~-1 + as.factor(endp) + as.factor(endp):Z.sas|as.factor(trials), correlation = corSymm(form=~1|as.factor(trials)/as.factor(id)), weights=varIdent(form=~1|endp)) hh
2002 May 29
1
Extracting intercept and residual std dev from lme results
Greetings- I need to extract, programatically, the standard deviations of the intercept and residuals from an lme model. These are presented by print.lme as: ... (Intercept) Residual StdDev: 1.410635 0.7800512 ... (data taken from ?lme's examples section) I can get the residuals with x$sigma where x is the fitted lme object. I can't find the intercept, though. The closest
2006 Mar 07
1
lme and gls : accessing values from correlation structure and variance functions
Dear R-users I am relatively new to R, i hope my many novice questions are welcome. I have problems accessing some objects (specifically the random effects, correlation structure and variance function) from an object of class gls and lme. I used the following models: yah <- gls (outcome~ -1 + as.factor(Trial):as.factor(endpoint)+
2008 May 30
4
Request: Documentation of formulae
In working through material on p.272 of MASS (4th ed.), I came across the following model formula: pet1.lm <- lm(Y ~ No/EP - 1, Petrol) I was at a loss to understand the use of "/" until I looked in "An Introduction [!] to R," where I found the explanation. My request is that more complete material on model formulae be lifted from "Introduction to R" (or
2008 Sep 26
1
Error in Cut command - 'x' must be numeric?
Hi Everyone I have a data set I want to bucket into deciles. Have been trying (without) success to use cut and using online help to understand my error. Here is my code to read in a few sample rows. I want to then create deciles by this variable > a<-read.csv("c:/temp/petrol.csv",header=TRUE,sep=",") > a tot_rdm_amt 1 40.15 2 332.65 3 533.37 4
2013 Jun 07
1
Function nlme::lme in Ubuntu (but not Win or OS X): "Non-positive definite approximate variance-covariance"
Dear all, I am estimating a mixed-model in Ubuntu Raring (13.04ΒΈ amd64), with the code: fm0 <- lme(rt ~ run + group * stim * cond, random=list( subj=pdSymm(~ 1 + run), subj=pdSymm(~ 0 + stim)), data=mydat1) When I check the approximate variance-covariance matrix, I get: > fm0$apVar [1] "Non-positive definite
1999 Jun 06
0
No subject
Dear friends. I downloaded the most recent of everything. Now the directory structure when installing VR5_3pl037.zip in library seem to have been disturbed - at least on my old machine. ....... R : Copyright 1999, The R Development Core Team Version 0.64.1 (May 8, 1999) ......... > library(VR) Warning: Package `VR' contains no R code > data(petrol) Warning: Data set `petrol' not
2004 Aug 03
2
lme fitted correlation of random effects: where is it?
The print method for lme *prints out* the fitted correlation matrix for the random effects. Is there any way to get these values as an object in R? I have examined the components of the lme object (called "junk" in the example below) and the components of summary(junk) without finding these numbers. (How I did this: I dumped the entire lme object to a text file and then used egrep to
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
2006 Jun 01
1
understanding the verbose output in nlme
Hi I have found some postings referring to the fact that one can try and understand why a particular model is failing to solve/converge from the verbose output one can generate when fitting a nonlinear mixed model. I am trying to understand this output and have not been able to find out much: **Iteration 1 LME step: Loglik: -237.4517 , nlm iterations: 22 reStruct parameters: subjectno1