Displaying 20 results from an estimated 5000 matches similar to: "lme: Testing variance components"
2012 May 14
1
Extract Variance Components
Hi,
I'm still having problems putting the variance components of my model in to
a data frame, it is a continuation of this discussion,
http://r.789695.n4.nabble.com/ANOVA-problem-td4609062.html, but now focussed
on the problem of extracting variance components. I have got my mixed
effects model now
/narrow$line<-as.factor(narrow$line)
rg.lmer <- lapply(split(narrow,
2006 Feb 20
1
Extracting variance components from lmer
Hi All.
I need a bit of help extracting the residual error variance from the VarCorr
structure from lmer.
#Here's a 2-way random effects model
lmer.1 <- lmer(rating ~ (1|person)+(1|rater), data = dat)
#Get the structure
vc.fit <- VarCorr(lmer.1)
#results in.....
$person
1 x 1 Matrix of class "dpoMatrix"
(Intercept)
(Intercept) 0.7755392
$rater
1 x 1 Matrix
2006 Sep 04
1
Problem with Variance Components (and general glmm confusion)
Dear list,
I am having some problems with extracting Variance Components from a random-effects model:
I am running a simple random-effects model using lme:
model<-lme(y~1,random=~1|groupA/groupB)
which returns the output for the StdDev of the Random effects, and model AIC etc as expected.
Until yesterday I was using R v. 2.0, and had no problem in calling the variance components of the
2012 Jun 26
1
How to estimate variance components with lmer for models with random effects and compare them with lme results
Hi,
I performed an experiment where I raised different families coming from two
different source populations, where each family was split up into a
different treatments. After the experiment I measured several traits on each
individual.
To test for an effect of either treatment or source as well as their
interaction, I used a linear mixed effect model with family as random
factor, i.e.
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,
2001 Nov 14
2
lme: how to extract the variance components?
Dear all,
Here is the question:
For example, using the "petrol" data offered with R.
pet3.lme<-lme(Y~SG+VP+V10+EP,random=~1|No,data=petrol)
pet3.lme$sigma gives the residual StdDev.
But I can't figure out how to extract the "(intercept) StdDev",
although it is in the print out if I do "summary(pet3.lme)".
In
2011 Mar 01
1
Components of variance with lme
R 2.10
Windows Vista
Is it possible to run a variance-components analysis using lme? I looked at Pinheiro and Bates' book and don't see code that will perform these analyses. If the analyses can not be done using lme, what package might I try?
Thanks,
John
John David Sorkin M.D., Ph.D.
Chief, Biostatistics and Informatics
University of Maryland School of Medicine Division of Gerontology
2012 Nov 27
0
Variance component estimation in glmmPQL
Hi all,
I've been attempting to fit a logistic glmm using glmmPQL in order to
estimate variance components for a score test, where the model is of the
form logit(mu) = X*a+ Z1*b1 + Z2*b2. Z1 and Z2 are actually reduced rank
square root matrices of the assumed covariance structure (up to a constant)
of random effects c1 and c2, respectively, such that b1 ~ N(0,sig.1^2*I) and
c1 ~
2005 Jun 24
1
lme4 extracting individual variance components
Hi,
For further calculations I need to extract indivdual Variances of
different random effects from a fitted model.
I found out how to extract the correlations
(VarCorr(m1)@reSumry$group1) but I was not able to find a way to
extract the other components individually.
To extract the Residuals I tried: (ranef(m1)@ stdErr) which
unfortunately did not work.
Thank you very much for your help!
2006 Sep 23
1
variance-covariance structure of random effects in lme
Dear R users,
I have a question about the patterned variance-covariance structure for the random effects in linear mixed effect model.
I am reading section 4.2.2 of "Mixed-Effects Models in S and S-Plus" by Jose Pinheiro and Douglas Bates.
There is an example of defining a compound symmetry variance-covariance structure for the random effects in a
split-plot experiment on varieties of
2006 Aug 08
3
Pairwise n for large correlation tables?
Hello,
I'm using a very large data set (n > 100,000 for 7 columns), for which I'm
pretty happy dealing with pairwise-deleted correlations to populate my
correlation table. E.g.,
a <- cor(cbind(col1, col2, col3),use="pairwise.complete.obs")
...however, I am interested in the number of cases used to compute each
cell of the correlation table. I am unable to find such a
2004 Dec 31
1
lme: Confusion about Variances
Dear R users!
I used lme to fit a mixed model with random intercept and spatial Gaussian
correlation i.e. I fitted a model of the following form:
Y = X*beta + error
and
error = U + W(t) + Z
where U is the random intercept (normally distributed), W(t) the stationary
Gaussian process and Z also a normally distributed (the residual) rv. Each of
these three random variables have a variance which
2008 Feb 05
1
Extracting level-1 variance from lmer()
All,
How does one extract the level-1 variance from a model fit via lmer()?
In the code below the level-2 variance component may be obtained via
subscripting, but what about the level-1 variance, viz., the 3.215072 term?
(actually this term squared) Didn't see anything in the archives on this.
Cheers,
David
> fm <- lmer( dv ~ time.num*drug + (1 | Patient.new), data=dat.new )
2005 Dec 12
2
convergence error (lme) which depends on the version of nlme (?)
Dear list members,
the following hlm was constructed:
hlm <- groupedData(laut ~ design | grpzugeh, data = imp.not.I)
the grouped data object is located at and can be downloaded:
www.anicca-vijja.de/lg/hlm_example.Rdata
The following works:
library(nlme)
summary( fitlme <- lme(hlm) )
with output:
...
AIC BIC logLik
425.3768 465.6087 -197.6884
Random effects:
2003 Dec 17
2
variance estimates in lme biased?
Hi all,
I didn't get a response to my post of this issue a week ago, so I've
tried to clarify:
When I use lme to analyze a model of nested random effects, the variance
estimates of levels higher in the hierarchy appear to have much more
variance than they should.
In the example below with 4 levels, I simulate variance in level 2
(sd=1.0) and level 4 (sd=0.1), but levels 1 and 3 do
2003 Mar 03
0
lm, gee and lme
Behavioral science data is often collected from nested structures (students
in schools, in districts, etc.). This can produce nonindependence among
responses from individuals in the same groups. Consequently, researchers
are advised to model the nested nature of the data to avoid biases in SE
estimates.
Failing to account for nonindependence can lead to SE estimates that are too
large or too
2003 Dec 02
1
question regarding variance components
I am using a two-factor ANOVA model with random factor effects including
the interaction, i.e. the factors are crossed. I would like to be able to
generate all four variance components along with approximate confidence
intervals using the NLME package. However, I do not know how to specify
the random option because of two problems. First, I do not know how to
enter the interaction term into the
2007 Apr 09
1
testing differences between slope differences with lme
hello
i have a mixed effect model which gives slope and intercept terms for 6
groups (diagnosis (3 levels) by risk group(2 levels)). the fixed part of
the model is --
brain volume ~ Diagnosis + Risk Group + (Risk Group * age : Diagnosis) - 1
thus allowing risk group age/slope terms to vary within diagnosis and
omitting a nonsignificant diagnosis by risk group intercept (age was
centered)
2006 May 08
1
Repeatability and lme
Dear R-help list members
I gathered longitudinal data on fish behaviour which I try to analyse using
a multi level model for change. Mostly, I am following Singer & Willett
(2003), who provide also the S/R code for their examples in the book (e.g.
http://www.ats.ucla.edu/stat/Splus/examples/alda/ch4.htm). Of course I am
interested in change over time, but I am also very much interested in
2008 Aug 29
3
extract variance components
HI,
I would like to extract the variance components estimation in lme function
like
a.fit<-lme(distance~age, data=aaa, random=~day/subject)
There should be three variances \sigma_day, \sigma_{day %in% subject } and
\sigma_e.
I can extract the \sigma_e using something like a.fit$var. However, I cannot
manage to extract the first two variance components. I can only see the
results in