Displaying 20 results from an estimated 10000 matches similar to: "Crossed random factors in lme"
2010 Oct 18
1
Crossed random effects in lme
Dear all,
I am trying to fit a model with crossed random effects using lme. In this
experiment, I have been measuring oxygen consumption (mlmin) in bird
nestlings, originating from three different treatments (treat), in a
respirometer with 7 different channels (ch). I have also measured body mass
(mass) for these birds.
id nest treat year mlmin mass ch hack
1EP51711 17
2003 Oct 31
1
cross-classified random factors in lme without blocking
On page 165 of Mixed-Effects Models in S and S-Plus by Pinheiro and Bates
there is an example of using lme() in the nlme package to fit a model with
crossed random factors. The example assumes though that the data is
grouped. Is it possible to use lme() to fit crossed random factors when the
data is not grouped?
E.g., y <- rnorm(12); a=gl(4,1,12); b=gl(3,4,12). Can I fit an additive
model
2006 Apr 22
1
Partially crossed and nested random factors in lme/lmer
Hi all,
I am not a very proficient R-user yet, so I hope I am not wasting people?s
time. I want to run a linear mixed model with 3 random factors (A, B, C)
where A and B are partially crossed and C is nested within B. I understand
that this is not easily possible using lme but it might be using lmer. I
encountered two problems when trying:
Firstly, I can enter two random factors in lmer but
2003 Sep 25
0
mixing nested and crossed factors using lme
Hi all,
I have an experiment where 5 raters assessed the quality of 24 web sites. (each rater rated each site once). I want to come up with a measure of reliability of the ratings for the web sites ie to what extent does each rater give the same (or similar) rating to each web site. My idea was to fit a random effects model using lme and from that, calculate the intraclass correlation as a
2007 Mar 06
0
different random effects for each level of a factor in lme
I have an interesting lme - problem. The data is part of the Master
Thesis of my friend, and she had some problems analysing this data,
until one of her Jurors proposed to use linear mixed-effect models. I'm
trying to help her since she has no experience with R. I'm very used to
R but have very few experience with lme.
The group calls of one species of parrot were recorded at many
2012 Mar 09
0
pdMat class in LME to mimic SAS proc mixed group option? Group-specific random slopes
I would like to be able to use lme to fit random effect models In which some but not all of the random effects are constrained to be independent. It seems as thought the pdMat options in lme are a promising avenue. However, none of the existing pdMat classes seem to allow what I want.
As a specific example, I would like to fit a random intercept/slope mixed model to longitudinal observations in
2018 Feb 21
1
Specify multiple nested random effects in lme with heteroskedastic variance across group
I want to fit a random effects model with two separate nested random
effects. I can easily do this using the `lmer` package in R. Here's how:
model<-lmer(y ~ 1 + x + (1 | oid/gid) + (1 | did/gid), data=data)
Here, I'm fitting a random intercept for `oid` nested within `gid` and
`did` nested within `gid`. This works well. However, I want to fit a model
where the variance of the
2006 Jun 01
1
setting the random-effects covariance matrix in lme
Dear R-users,
I have longitudinal data and would like to fit a model where both the variance-covariance matrix of the random effects and the residual variance are conditional on a (binary) grouping variable.
I guess the model would have the following form (in hierarchical notation)
Yi|bi,k ~ N(XiB+Zibi, sigmak*Ident)
bi|k ~ N(0, Dk)
K~Bernoulli(p)
I can obtain different sigmas (sigma0 and
2010 Mar 22
0
using lmer weights argument to represent heteroskedasticity
Hi-
I want to fit a model with crossed random effects and heteroskedastic
level-1 errors where inferences about fixed effects are of primary
interest. The dimension of the random effects is making the model
computationally prohibitive using lme() where I could model the
heteroskedasticity with the "weights" argument. I am aware that the weights
argument to lmer() cannot be used to
2011 Jun 02
0
allowing individual level correlations to differ by cluster in lme in R
Dear R-listers,
I am fitting bivariate mixed models for cost-effectiveness data of cluster randomized trials using lme in R. So I have individuals nested within clusters. My response variable is a vector with bivariate response (individual level costs and effects) stacked into a single column. The covariates in my models are a constant and a treatment term. They are response-specific, e.g. a
2004 May 27
1
Crossed random effects in lme
Dear all,
In the SASmixed package there is an example of an analysis of a split-plot experiment. The model is
fm1Semi <- lme( resistance ~ ET * position, data = Semiconductor, random = ~ 1 | Grp)
where Grp in the Semiconductor dataset is defined as ET*Wafer. Is it possible to specify the grouping directly some way, e.g. like
fm1Semi <- lme( resistance ~ ET * position, data =
2004 Jul 12
2
lme unequal random-effects variances varIdent pdMat Pinheiro Bates nlme
How does one implement a likelihood-ratio test, to test whether the
variances of the random effects differ between two groups of subjects?
Suppose your data consist of repeated measures on subjects belonging to
two groups, say boys and girls, and you are fitting a linear mixed-effects
model for the response as a function of time. The within-subject errors
(residuals) have the same variance in
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,
2005 Jun 15
1
anova.lme error
Hi,
I am working with R version 2.1.0, and I seem to have run into what looks
like a bug. I get the same error message when I run R on Windows as well as
when I run it on Linux.
When I call anova to do a LR test from inside a function, I get an error.
The same call works outside of a function. It appears to not find the right
environment when called from inside a function. I have provided
2010 Oct 04
1
Fixed variance structure for lme
I have a data set with 50 different x values and 5 values for the sampling
variance; each of the 5 sampling variances corresponds to 10 particular x
values. I am trying to fit a mixed effect linear model and I'm not sure
about the syntax for specifying the fixed variance structure. In Pinheiro's
book my situation appears to be similar to the example used for varIdent,
where there is a
2007 May 21
1
can I get same results using lme and gls?
Hi All
I was wondering how to get the same results with gls and lme. In my lme, the
design matrix for the random effects is (should be) a identity matrix and
therefore G should add up with R to produce the R matrix that gls would report
(V=ZGZ'+R). Added complexity is that I have 3 levels, so I have R, G and say H
(V=WHW'+ZGZ'+R). The lme is giving me the correct results, I am
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)+
2010 Jul 21
0
Piecewise regression using lme()
Hi everyone,
I'm trying to fit a of piecewise regression model on a time series. The idea
is to divide the series into segments and then to apply linear regression
models on each segment but in a "global way" and considering
heteroskedasticity between the segments. For example, I build a time series
y with 3 segments:
segment1=1:20+rnorm(20,0,2)
segment2=20-2*1:30+rnorm(30,0,5)
2003 Jun 19
2
Fitting particular repeated measures model with lme()
Hello,
I have a simulated data structure in which students are nested within
teachers, and with each student are associated two test scores. There
are 20 classrooms and 25 students per classroom, for a total of 500
students and two scores per student. Here are the first 10 lines of
my dataframe "d":
studid tchid Y time
1 1 1 -1.0833222 0
2 1 1
2007 Nov 27
2
lme object manipulation
Hello:
I have an lme object, say lme_res2, which was generated using the varIdent. I'm trying to extract the double 1.532940 from the object, but I can't find it by attributes(lme_res2) or attributes(summary(lme_res2)). How can I pull it out (so that I can save it to another variable)? Thanks.
Shin
Linear mixed-effects model fit by REML
Data: dat
Log-restricted-likelihood: