Displaying 20 results from an estimated 10000 matches similar to: "Variance and Covariance Matrix D and R in nlme or lme4."
2004 Aug 27
2
degrees of freedom (lme4 and nlme)
Hi, I'm having some problems regarding the packages
lme4 and nlme, more specifically in the denominator
degrees of freedom. I used data Orthodont for the two
packages. The commands used are below.
require(nlme)
data(Orthodont)
fm1<-lme(distance~age+ Sex,
data=Orthodont,random=~1|Subject, method="REML")
anova(fm1)
numDF DenDF F-value p-value
(Intercept) 1
2017 Aug 17
0
nlme package, fixing variance.covariance matrix of residuals
Dear R team,
I would like to do a multivariate meta-analysis in R using the nlme package. In meta-analysis I fix the residuals to known sampling errors. As I do a multivariate analysis, I have a variance-covariance matrix of sampling errors. Unfortunately, via varFixed I can only fix a vector of sampling errors and no matrix.
In the R package metafor using the rma.mv function I can insert the
2007 Sep 18
0
Extracting variance-covariance matrix from nlme object
I want to extract the variance-covariance matrix of an nlme model of
a dataset. The object is to pass this to mvrnorm to create pseudo-
replicates of the original data. I note the nlme package has a
getVarCov method available for lme objects but not nlme objects. Is
the vcov function in the base stats package suitable? If so, why is
the additional getVarCov provided?
thank you
Rob
2007 Sep 26
1
Accessing the fixed- and random-effects variance-covariance matrices of an nlme model
I would appreciate confirmation that the function vcov(model.nlme)
gives the var-cov matrix of the fixed effects in an nlme model.
Presumably the random-effects var-cov matrix is given by cov(ranef
(model.nlme)?
Rob Forsyth
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
2007 Nov 12
1
Using lme (nlme) to find the conditional variance of the random effects
Using lmer in the lme4 package, you can compute the conditional
variance-covariance matrix of the random effects using the bVar slot:
bVar: A list of the diagonal inner blocks (upper triangles only) of the
positive-definite matrices on the diagonal of the inverse of ZtZ+Omega.
With the appropriate scale factor (and conversion to a symmetric matrix)
these are the conditional variance-covariance
2010 Feb 14
1
Problem with specifying variance-covariance matrix for random effects (nlme package)
Hi all,
I've been struggling with trying to specify a diagnoal matrix for linear mixed effects model. I think I've got nearly everything correct, except the following message appears:
In lme.formula(fixed = fwave ~ sex + sexXbulbar + visit + age + :
Fewer observations than random effects in all level 1 groups
Not sure if i've provided enough details, but I'm basically trying
2003 Apr 04
0
nlme and variance-covariance matrices.
--
Dear R users,
I have data on around 2000 birds from 3 generations for which I know
an individual's pedigree (i.e. the relationship it shares with other
individuals e.g brother, uncle, mother) and also a pedigree based on
foster-families, because half broods were removed from their nest of
origin and placed in a foster parent's nest.
From this I want to model two types of random
2011 Sep 12
1
Multilevel model in lme4 and nlme
Dear list,
I am trying to fit some mixed models using packages lme4 and nlme.
I did the model selection using lmer but I suspect that I may have some
autocorrelation going on in my data so I would like to have a look using the
handy correlation structures available in nlme.
The problem is that I cannot translate my lmer model to lme:
mod1<- lmer(y~x + (1|a:b) + (1|b:c), data=mydata)
2005 Jan 03
1
different DF in package nlme and lme4
Hi all
I tried to reproduce an example with lme and used the Orthodont
dataset.
library(nlme)
fm2a.1 <- lme(distance ~ age + Sex, data = Orthodont, random = ~ 1 | Subject)
anova(fm2a.1)
> numDF denDF F-value p-value
> (Intercept) 1 80 4123.156 <.0001
> age 1 80 114.838 <.0001
> Sex 1 25 9.292 0.0054
or alternatively
2012 Jun 06
3
Sobel's test for mediation and lme4/nlme
Hello,
Any advice or pointers for implementing Sobel's test for mediation in
2-level model setting? For fitting the hierarchical models, I am using
"lme4" but could also revert to "nlme" since it is a relatively simple
varying intercept model and they yield identical estimates. I apologize for
this is an R question with an embedded statistical question.
I noticed that a
2006 Aug 22
1
Marginal Predicitions from nlme and lme4
Is there a way (simple or not) to get the marginal prediction from lme
(in nlme) and/or lmer (in lme4)?
Rick B.
2013 Mar 04
1
Choosing nlme or lme4?
Hi List,
I’ m analysing the selectivity of
resting site use by forest carnivores through mixed modelling techniques and I
wonder which will be the best r package to deal with several aspects simultaneously:
- binomial
variable response;
- possible
spatial and/or temporal correlation;
I have tried nlme (lme function) and
lme4 (lmer function) packages, however I realize that the
2005 Jul 13
1
crossed random fx nlme lme4
I need to specify a model similar to this
lme.formula(fixed = sqrt(lbPerAc) ~ y + season + y:season, data = cy,
random = ~y | observer/set, correlation = corARMA(q = 6))
except that observer and set are actually crossed instead of nested.
observer and set are factors
y and lbPerAc are numeric
If you know how to do it or have suggestions for reading I will be
grateful.
eal
ps I have
2005 Jan 28
3
Conflicts using Rcmdr, nlme and lme4
Hello all!
R2.0.1, W2k. All packages updated.
I?m heavily dependant on using mixed models. Up til?now I have used
lme() from nlme as I have been told to. Together with estimable() from
gmodels it works smooth. I also often run Rcmdr, mostly for quick
graphics.
After using Rcmdr, on reopening the R workspace all help libraries for
Rcmdr (22 !) loads, among them nlme, but not Rcmdr itself. Why?
2005 May 17
1
setting value arg of pdSymm() in nlme
Dear All,
I wish to model random effects that have known between-group covariance
structure using the lme() function from library nlme. However, I have yet
to get even a simple example to work. No doubt this is because I am
confusing my syntax, but I would appreciate any guidance as to how. I have
studied Pinheiro & Bates carefully (though it's always possible I've
missed
2003 Oct 23
1
Variance-covariance matrix for beta hat and b hat from lme
Dear all,
Given a LME model (following the notation of Pinheiro and Bates 2000) y_i
= X_i*beta + Z_i*b_i + e_i, is it possible to extract the
variance-covariance matrix for the estimated beta_i hat and b_i hat from the
lme fitted object?
The reason for needing this is because I want to have interval prediction on
the predicted values (at level = 0:1). The "predict.lme" seems to
2010 Oct 25
3
question in using nlme and lme4 for unbalanced data
Hello:
I have an two factorial random block design. It's a ecology
experiment. My two factors are, guild removal and enfa removal. Both
are two levels, 0 (no removal), 1 (removal). I have 5 blocks. But
within each block, it's unbalanced at plot level because I have 5
plots instead of 4 in each block. Within each block, I have 1 plot
with only guild removal, 1 plot with only enfa removal,
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
2011 Apr 18
1
covariance matrix: a erro and simple mixed model question, but id not know answer sorry
Dear list
I need your help: Execuse me for my limited R knowledge.
#example data set
set.seed (134)
lm=c(1:4)
block = c(rep(lm,6))
gen <- c(rep(1, 4), rep(2, 4), rep(3, 4), rep(4, 4),rep(5, 4),rep(6, 4))
X1 = c( rnorm (4, 10, 4), rnorm (4, 12, 6), rnorm (4, 10, 7),rnorm (4, 5, 2),
rnorm (4, 8, 4), rnorm (4,7, 2))
X2 = X1 + rnorm(length(X1), 0,3)
yvar <- c(X1, X2)
X <- c(rep( 1,