Displaying 20 results from an estimated 10000 matches similar to: "difference between lme and lmer in df calculation"
2008 Feb 04
1
extracting AIC scores from lmer and other objects
I have a slight conundrum. I'm attempting to write a scrip that will
take a number of objects (lm, glm, and lmer) and return AIC scores
and weights. I've run into 3 problems, and was wondering if anyone
had any pointers.
1) is there any convenient way to extract the name of the objects?
Simply, if I have a vector of objects c(my.lm, my.lmer) and I want to
get a character
2006 Sep 13
1
Updating lmer - object is not subsettable?
I'm attempting to write a general function to implement Faraway's
bootstrapping algorithm for mixed models with lmer, but have run into
a curious problem. I'm comparing two models
model.1<-lmer(Response ~ Treatment + (1|Trial), data=exp.data,
method="ML")
model.2<-lmer(Response ~ 1 + (1|Trial), data=exp.data, method="ML")
When I attempt to update
2007 Feb 28
0
no df to test the effect of an interaccion on a lmer mixed model
Dear useRs,
I am fitting a mixed model using the function lmer from the package lme4,
but I have some problems when I try to test the effect of my factors of
interest.
First let me explain the structure of the model:
I'm measuring animal movements. Explicitly, I am interested in displacement
(straight-line distance from an initial point). Displacements are measured
longitudinally, with one
2006 Mar 28
0
Why is AIC from lmer 2 less than that from lme?
I'm migrating to lmer() from lme(). I have noticed that AIC values from
lmer() are 2 units smaller than those reported by lme(). Could someone
please explain why?
The issue can be replicated with the first example from Pinheiro & Bates
(2000) Mixed-effects models in S and S-plus.
library(nlme)
Rail2 <- Rail
summary(lme(travel~1,data=Rail2,random=~1|Rail)) # AIC = 128.177
2011 Jun 01
1
different results from lme() and lmer()
Hello R-help,
I'm studying an example in the R book.?
The data file is available from the link below.http://www.bio.ic.ac.uk/research/mjcraw/therbook/data/fertilizer.txt
Could you explain Why the results from lme() and lmer() are different in the following case? In other examples, I can get the same results using the two functions, but not here...?
Thank you.Miya
library(lme4)library(nlme)#
2010 Sep 17
1
lmer() vs. lme() gave different variance component estimates
Hi, I asked this on mixed model mailing list, but that list is not very active,
so I'd like to try the general R mailing list. Sorry if anyone receives the
double post.
Hi, I have a dataset of animals receiving some eye treatments. There are 8
treatments, each animal's right and left eye was measured with some scores
(ranging from 0 to 7) 4 times after treatment. So there are
2007 Jul 31
1
Extracting random parameters from summary lme and lmer
LS,
I'm estimating multilevel regression models, using the lme-function
from the nlme-package. Let's say that I estimated a model and stored
it inside the object named 'model'. The summary of that model is
shown below:
Using summary(model)$tTable , I receive the following output:
> summary(model)$tTable
Value Std.Error DF t-value
2006 Jan 10
0
bug in either glmmPQL or lme/lmer
I know it's conventional to report bugs to the maintainer, but I'm not sure
which package actually contains this bug(s), so I apologize for sending this
to the list at large. I see the bug under both R 2.1.1, and R 2.2.1. (I sent
a related message a while ago, but this one has more detail.)
library(MASS)
library(nlme)
fit.model <- function(il, model.family) {
cs <-
2005 Dec 26
4
lme X lmer results
Hi,
this is not a new doubt, but is a doubt that I cant find a good response.
Look this output:
> m.lme <- lme(Yvar~Xvar,random=~1|Plot1/Plot2/Plot3)
> anova(m.lme)
numDF denDF F-value p-value
(Intercept) 1 860 210.2457 <.0001
Xvar 1 2 1.2352 0.3821
> summary(m.lme)
Linear mixed-effects model fit by REML
Data: NULL
AIC BIC
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.
2008 Oct 16
1
lmer for two models followed by anova to compare the two models
Dear Colleagues,
I run this model:
mod1 <- lmer(x~category+subcomp+category*subcomp+(1|id),data=impchiefsrm)
obtain this summary result:
Linear mixed-effects model fit by REML
Formula: x ~ category + subcomp + category * subcomp + (1 | id)
Data: impchiefsrm
AIC BIC logLik MLdeviance REMLdeviance
4102 4670 -1954 3665 3908
Random effects:
Groups Name Variance
2008 Mar 13
1
strange results from binomial lmer?
I'm running lmer repeatedly on artificial data with two fixed factors (called
'gender' and 'stress') and one random factor ('speaker'). Gender is a
between-speaker variable, stress is a within-speaker variable, if that matters.
Each dataset has 100 rows from each of 20 speakers, 2000 rows in all.
About 5% of the time I get a strange result, where the lmer() model with
2006 Oct 18
1
lmer- why do AIC, BIC, loglik change?
Hi all,
I am having issues comparing models with lmer. As an example, when
I run the code below the model summaries (AIC, BIC, loglik) differ between
the summary() and anova() commands. Can anyone clear up what's wrong?
Thank you!
Darren Ward
library(lme4)
data(sleepstudy)
fm1<-lmer(Reaction ~ Days + (1|Subject), sleepstudy)
summary(fm1)
fm2<-lmer(Reaction ~ Days +
2006 Jul 28
3
random effects with lmer() and lme(), three random factors
Hi, all,
I have a question about random effects model. I am dealing with a
three-factor experiment dataset. The response variable y is modeled
against three factors: Samples, Operators, and Runs. The experimental
design is as follow:
4 samples were randomly chosen from a large pool of test samples. Each
of the 4 samples was analyzed by 4 operators, randomly selected from a
group of
2006 Oct 05
1
lmer BIC changes between output and anova
list,
i am using lmer to fit multilevel models and trying to use anova to compare the models. however, whenever i run the anova, the AIC, BIC and loglik are different from the original model output- as below. can someone help me out with why this is happening? (i'm hoping the output assocaited with the anova is right!).
thank you,
darren
> unconditional<-lmer(log50 ~ 1 + (1 |
2009 Apr 15
2
AICs from lmer different with summary and anova
Dear R Helpers,
I have noticed that when I use lmer to analyse data, the summary function
gives different values for the AIC, BIC and log-likelihood compared with the
anova function.
Here is a sample program
#make some data
set.seed(1);
datx=data.frame(array(runif(720),c(240,3),dimnames=list(NULL,c('x1','x2','y'
))))
id=rep(1:120,2); datx=cbind(id,datx)
#give x1 a
2007 Jun 21
1
Extract Df under lme4
I need to extract the degrees of freedom and log likelihoods from a
series of mixed models computed using lmer/lme4. If I ask for logLik
(lmer.object), I get something like
> logLik(lmer.object)
'log Lik.' -177.1000 (df=10)
Can I easily get that df from there (or elsewhere) into an object?
Thank you for any ideas.
George
2008 May 06
1
question about se of predicted glm values
Hey, all. I had a quick question about fitting new glm values and
then looking at the error around them. I'm working with a glm using a
Gamma distribution and a log link with two types of treatments.
However, when I then look at the predicted values for each category, I
find for the one that is close to 0, the error (using se.fit=T with
predicted) actually makes it overlap 0.
2005 Oct 07
2
AIC in lmer
Hello all,
Is AIC calculated incorrectly in lmer? It appears as though it uses
AIC = -2*logLik - 2*#parms, instead of -2*LogLik + 2*#parms? Below is
output from one of many models I have tried:
Generalized linear mixed model fit using PQL
Formula: cswa ~ pcov.ess1k + (1 | year)
Data: ptct50.5
Family: poisson(log link)
AIC BIC logLik deviance
224.8466 219.19 -114.4233 228.8466
2007 Sep 19
1
lmer using quasibinomial family
Dear all, I try to consider overdispersion in a lmer model. But using
family=quasibinomial rather than family=binomial seems to change the fit but
not the result of an anova test. In addition if we specify test="F" as it is
recomanded for glm using quasibinomial, the test remains a Chisq test. Are
all tests scaled for dispersion, or none? Why is there a difference between
glm and lmer