search for: lmer1

Displaying 16 results from an estimated 16 matches for "lmer1".

Did you mean: lmer
2007 Oct 08
0
Residuals for binomial lmer fits
...lmer fit objects? I tried searching the r-help archive and found nothing. I tried and failed to replicate what (I guessed would be equivalent to what) resid does, starting with one predictor and a random intercept. The residuals output by resid had the following properties: > summary(resid(lmer1)) Min. 1st Qu. Median Mean 3rd Qu. Max. -5.92e+01 -1.29e+01 -1.10e+00 2.62e-15 1.31e+01 6.66e+01 > sd(resid(lmer1)) [1] 19.6 My naive method gave: > summary(my.resids) Min. 1st Qu. Median Mean 3rd Qu. Max. -1.84e+02 -3.81e+01 3.12e+00 -1.9...
2012 Dec 29
1
AIC values with lmer and anova function
...t reached without convergence (10) LME1 = lme(X ~ Group*Day, random = ~Day|Individual) Erro em lme.formula(X ~ Group * Day, random = ~Day | Individual) : nlminb problem, convergence error code = 1 message = iteration limit reached without convergence (10) LMER = lmer(X ~ 1 + (Day|Individual)) LMER1 = lmer(X ~ Group*Day + (Day|Individual)) AIC(LMER) [1] -179.0302 AIC(LMER1) [1] -151.1938 anova(LMER,LMER1) Data: Models: LMER: X ~ 1 + (Day | Individual) LMER1: X ~ Group * Day + (Day | Individual) Df AIC BIC logLik Chisq Chi Df Pr(>Chisq) LMER 5 -187.2 -177.26 98.602 LMER1...
2010 Dec 29
2
as.object: function doesn't exist but I wish it did
I seem to come to this problem alot, and I can find my way out of it with a loop, but I wish, and wonder if there is a better way. Here's an example (lmer1-5 are a series of lmer objects): bs=data.frame(bic=BIC(lmer1,lmer2,lmer3,lmer4,lmer5)$BIC) rownames(bs)=c('lmer1','lmer2','lmer3','lmer4','lmer5') best=rownames(bs)[bs==min(bs)] > best [1] "lmer5" This tells me that lmer5 is the model with...
2007 Aug 13
0
R^2 for multilevel models
...odel lm1 = lm(y ~ x, data = thedata) summary(lm1) # Use the model to get the R^2 predicted = coef(lm1)[1] + thedata$x * coef(lm1)[2] plot(thedata$y, predicted) # It's a noisy mess cor(thedata$y, predicted)^2 # Now how about adjusting everyone's intercept towards the group # intercept? lmer1 = lmer(y ~ x + (1|id), data=thedata) summary(lmer1) # Get the random intercepts and stick them in a table ran_effects = data.frame(rownames(ranef(lmer1)$id), ranef(lmer1)$id[1]) names(ran_effects) = c("id", "b") ran_effects_data = merge(thedata, ran_effects) # Now compute pr...
2006 Apr 28
1
variance using lmer
Dear R help I have a question on the variance of the binomial probit model. I have fitted the following model : > lmer1<-lmer(mp ~ l + op + l*op+ us_lev + bw_lev +(1|tatu) , + family = binomial(link="probit"), + method = 'Laplace', + data = matings, + msVerbose= True) > summary(lmer1) Generalized linear mixed model fit using Lapla...
2008 Oct 30
0
lme4/anova, error message: "Calculated PWRSS for a LMM is negative"
Dear all, I'm using the latest version of the package lme4 and R version 2.7.2 (2008-08-25). After I run the model, I get the results of the model (cf. below). Then, I run an ANOVA using the "anova" function and I get the following message "Error in anova(lmer1) : Calculated PWRSS for a LMM is negative". I went trough the R-mailing list and a similar error message was reported but only when using "weights". As I did not use "weights" in my model, I was wondering what could cause this error message! Thanks in advance for any adv...
2007 Jan 26
0
R crash with modified lmer code
Hi all, I've now got a problem with some modified lmer code (function lmer1 pasted at end) - I've made only three changes to the lmer code (marked), and I'm not really looking for comments on this function, but would like to know why execution of the following commands that use it almost invariably (but not quite predictably) leads to the R session terminating. He...
2010 Feb 01
2
Missing names in LMER and GLM
...-this is made up of MM, MB, MN and MNX passes = 3, 5, 1, 6, 3, 6, 3, ... - this is made up of integer values, each corresponding to either MM, MB, MN or MNX as in Calls Night = 1, 4, 5, 2, 4, 1, ... - this is made up of integers from 1 to 5, and is a random variable The command I use is LMER1 <- lmer(passes ~ Calls + (1|Night), family=Poisson, data=importeddata) My problem is that when I then do 'summary(LMER1)' I get some missing values, for example, myfixed effects are: CallsMM 71.24 14.24 ...etc CallsMB .... .... ... CallsMN...
2005 Sep 19
1
How to mimic pdMat of lme under lmer?
...91,52.43,52.26,52.33,51.58,51.23) DS <- data.frame(F,R,s) DS$F <- as.factor(DS$F) DS$R <- as.factor(DS$R) library(nlme) lme1 <- lme(data = DS,s ~ F,random = list(R = pdLogChol(~F))) lme2 <- lme(data = DS,s ~ F,random = list(R = pdDiag(~F))) summary(lme1) summary(lme2) library(lme4) lmer1 <- lmer(data = DS,s ~ F + (F|R)) lmer2 <- lmer(data = DS,s ~ F + (1|R) + (1|F)) summary(lmer1) summary(lmer2) confidentiality notice: The information contained in this e-mail is confidential and...{{dropped}}
2007 Dec 02
0
error messgage in lmer for random intercept and slope model
Greetings, I am trying to run a logistic regression model for binary data with a random intercept and slope in R 2.6.1. When I use the code: lmer1<-lmer(infect ~ time+gender + (1+time|id), family=binomial, data=ichs, method="Laplace") Then from: summary(lmer1) I get the message: Error in if (any(sd < 0)) return("'sd' slot has negative entries") : missing value where TRUE/FALSE needed The model with jus...
2008 Feb 13
1
lmer: Estimated variance-covariance is singular, false convergence
...them by anova(): > cracks.lmer <- lmer (Cover ~ Cracks + Distance + (Cracks + Distance | > + Site / ID.Transekt) , method = ("ML")) Warning message: In .local(x, ..., value) : Estimated variance-covariance for factors ?ID.Transekt:Site?, ?Site? is singular > cracks.lmer1 <- lmer (Cover ~ Cracks + (Cracks | Site / ID.Transekt) , > + data = Lmm.spalten.corr, method = ("ML")) Warning messages: 1: In .local(x, ..., value) : Estimated variance-covariance for factor ?Site? is singular 2: In .local(x, ..., value) : nlminb returned message false co...
2007 Mar 30
0
problem using mcmcsamp() with glmer models containing interaction terms in fixed effects
...-fishing reserve region <- as.factor(rep(c("island1", "island2"),50)) # spatial grouping factor data1 <- data.frame(counts, visit, zone, region) rm (counts, visit, zone, region) # a quick look bwplot(I(sqrt(counts))~as.factor(visit)|region, data=data1) # two lmer models lmer1 <- lmer (counts~visit+visit:zone + (1|region), data=data1, family=poisson(link="log")) lmer2 <- lmer (counts~visit+visit:zone + (visit+visit:zone|region), data=data1, family=poisson(link="log")) mcmc1 <- mcmcsamp(lmer1, n=10000) # works mcmc2 <- mcmcsamp(lmer2, n=1...
2007 Jul 22
1
summary of linear fixed effects model is different than the HSAUR book
...way through Everitt and Hothorn's "Handbook of Statistical Analyses Using R," c 2006. (No, it's not homework.) Chapter 10 discusses linear mixed effects models for longitudinal data. I've called my long data frame BtheB.long Here's the model from the book, which I run. lmer1 <- lmer(bdi ~ bdi.pre + months + treatment + drug + length + (1 | subject), data = BtheB.long, method = "ML", na.action = na.omit) Here is the summary of the model that I see: > summary(lmer1) Linear mixed-effects model fit by maximum likelihood Formula: bdi ~ bdi.pre + months + t...
2007 May 16
1
lmer error confusion
...RT)) str(priming) 'data.frame': 18 obs. of 4 variables: $ Subj: num 1 1 1 1 1 1 2 2 2 2 ... $ Item: num 1 2 3 1 2 3 1 2 3 1 ... $ SOA : num 1 1 1 2 2 2 1 1 1 2 ... $ RT : num 466 520 502 475 494 490 516 566 577 491 ... #Here's the call taken directly from the paper priming.lmer1 <- lmer(RT ~ SOA + (1 | Item) + (1 | Subj), data = priming) #Here's the error.... Error in rbind(Item = <S4 object of class "dgCMatrix">, Subj = <S4 object of class "dgCMatrix">) : cannot coerce type S4 to list vector Any idea what I'm doing wron...
2006 Feb 12
1
Mathematical typesetting of column heads using the latex (Hmisc) function
...The following command (in a .Rnw file) latex(anova(e7.lmer3, e7.lmer4), file = 'e7lmer34.tex', rowname = c ('nonlinear', 'linear'), longtable = FALSE, dcolumn = T, booktabs = T, table.env = F) produces the following output after running Sweave: % latex.default(anova(e7.lmer1, e7.lmer2), file = "e7lmer12.tex", rowname = c("nonlinear", "linear"), longtable = FALSE, dcolumn = T, booktabs = T, table.env = F) % \newcolumntype{.}{D{.}{.}{-1}} \begin{center} \begin{tabular}{l.......}\toprule \multicolumn{1}{l}{anova}& \multicolu...
2012 May 08
2
mgcv: inclusion of random intercept in model - based on p-value of smooth or anova?
...hese situations. Do I include the random intercept or not? I also have a related question. When I used to create a mixed-effects regression model using lmer and included e.g., an interaction in the fixed-effects structure, I would test if the inclusion of this interaction was warranted using anova(lmer1,lmer2). It then would show me that I invested 1 additional df and the resulting (possibly significant) improvement in fit of my model. This approach does not seem to work when using gam. In this case an apparent investment of 1 degree of freedom for the interaction, might result in an actual decre...