[R] lmer error: number of observations <= number of random effects

2024-05-06 Thread Srinidhi Jayakumar via R-help
I am running a multilevel growth curve model to examine predictors of social anhedonia (SA) trajectory through ages 12, 15 and 18. SA is a continuous numeric variable. The age variable (Index1) has been coded as 0 for age 12, 1 for age 15 and 2 for age 18. I am currently using a time varying predic

[R] lmer causes R session to terminate

2016-07-07 Thread David Kikuchi
Hi, I am working with a large dataset of neotropical birds, and am trying to partition the variance in log(body mass) within different taxonomic levels. To better explain what I mean, the taxonomic levels are species, genus, family, and order. Species are within genera, genera are within famillies

Re: [R] LMER - generate data and define model (2 fixed effects and 1 random effect or 1 fixed effect and 2 random effects)

2015-08-11 Thread Bert Gunter
You need to: 1) Re-read ?seq. Your syntax is wrong. ("," not ":" ) 2) Note that (n-1) x m != n x m Cheers, Bert Bert Gunter "Data is not information. Information is not knowledge. And knowledge is certainly not wisdom." -- Clifford Stoll On Tue, Aug 11, 2015 at 2:21 AM, Rosa Oliveira wro

Re: [R] LMER - generate data and define model (2 fixed effects and 1 random effect or 1 fixed effect and 2 random effects)

2015-08-11 Thread Rosa Oliveira
Dear Thierry, even using the code: id.pat = rep(seq(1:nsample), each =n.longitudinal.observations) time = rep(seq(1:n.longitudinal.observations)-1, nsample) age = rnorm(nsample, mean = 36, sd = .8) f.age

Re: [R] LMER - generate data and define model (2 fixed effects and 1 random effect or 1 fixed effect and 2 random effects)

2015-08-11 Thread Rosa Oliveira
Dear Thierry id.pat = rep(seq(1:nsample), each =n.longitudinal.observations) time = rep(seq(1:n.longitudinal.observations)-1, nsample) age = rnorm(nsample, mean = 36, sd = .8) f.age= table(cut(age, b

Re: [R] LMER - generate data and define model (2 fixed effects and 1 random effect or 1 fixed effect and 2 random effects)

2015-08-11 Thread Thierry Onkelinx
Dear Rosa, 1) use cut() to convert a continuous variable into a factor. See ?cut for the details. 2) The syntax for factors is the same as for continuous variables. Just add the name of the factor variable to the formula fAge <- cut(age) yy~1+fAge+time+(time|id.pat) 3) Add + (1|fAge) to the formul

[R] LMER - generate data and define model (2 fixed effects and 1 random effect or 1 fixed effect and 2 random effects)

2015-08-10 Thread Rosa Oliveira
### # Clear memory and set the working directory and the seed ### rm(list = ls()) setwd("/Dropbox/LMER/R ") set.seed(7010) ###

Re: [R] R lmer debugging: Error in [[<-.data.frame(*tmp*, i, value = integer(0)) : replacement has 0 rows, data has 117

2013-12-03 Thread Ben Bolker
Cynthia Tedore biol.lu.se> writes: > > males is a factor. If I don't specify that, then it > treats it as a numeric. > any other suggestions? transform(spiders,focal.chel=as.numeric(focal.chel), opponent.chel=as.numeric(opponent.chel),fmales=factor(males)) model1<-lmer(threatened~focal

Re: [R] R lmer debugging: Error in [[<-.data.frame(*tmp*, i, value = integer(0)) : replacement has 0 rows, data has 117

2013-12-03 Thread Cynthia Tedore
males is a factor. If I don't specify that, then it treats it as a numeric. any other suggestions? On Tue, Dec 3, 2013 at 11:25 AM, Pascal Oettli wrote: > Hello, > > I get a result if I change 'as.factor(males)' to 'males'. > > Hope this helps, > Pascal > > On 3 December 2013 18:43, Cynthia Ted

Re: [R] R lmer debugging: Error in [[<-.data.frame(*tmp*, i, value = integer(0)) : replacement has 0 rows, data has 117

2013-12-03 Thread Ben Bolker
Pascal Oettli ymail.com> writes: > > Hello, > > I get a result if I change 'as.factor(males)' to 'males'. > > Hope this helps, > Pascal > > On 3 December 2013 18:43, Cynthia Tedore biol.lu.se> > wrote: > > I am able to use lmer on an older computer without this error, but the new > > versio

Re: [R] R lmer debugging: Error in [[<-.data.frame(*tmp*, i, value = integer(0)) : replacement has 0 rows, data has 117

2013-12-03 Thread Pascal Oettli
Hello, I get a result if I change 'as.factor(males)' to 'males'. Hope this helps, Pascal On 3 December 2013 18:43, Cynthia Tedore wrote: > I am able to use lmer on an older computer without this error, but the new > version (downloaded yesterday) gives me this error message: > > Error in [[<-.d

[R] R lmer debugging: Error in [[<-.data.frame(*tmp*, i, value = integer(0)) : replacement has 0 rows, data has 117

2013-12-03 Thread Cynthia Tedore
I am able to use lmer on an older computer without this error, but the new version (downloaded yesterday) gives me this error message: Error in [[<-.data.frame(*tmp*, i, value = integer(0)) : replacement has 0 rows, data has 117 in response to this function: model1<-lmer(threatened~as.numeric(fo

[R] R: lmer specification for random effects: contradictory reults

2013-11-25 Thread Benedetta Cesqui
.@inbo.be] Inviato: lunedì 25 novembre 2013 14:48 A: Benedetta Cesqui; r-help@r-project.org Cc: r-sig-mixed-mod...@r-project.org Oggetto: RE: [R] lmer specification for random effects: contradictory reults Dear Benedetta, I think you might want (1+T+Z|subject) as random effects rather than (1+

Re: [R] lmer specification for random effects: contradictory reults

2013-11-25 Thread ONKELINX, Thierry
1:13 Aan: r-help@r-project.org Onderwerp: [R] lmer specification for random effects: contradictory reults Hi All, I was wondering if someone could help me to solve this issue with lmer. In order to understand the best mixed effects model to fit my data, I compared the following options according

[R] lmer specification for random effects: contradictory reults

2013-11-25 Thread Benedetta Cesqui
Hi All, I was wondering if someone could help me to solve this issue with lmer. In order to understand the best mixed effects model to fit my data, I compared the following options according to the procedures specified in many papers (i.e. Baayen

Re: [R] lmer( ) parameter estimates changing depending on dummy-coded reference level

2013-08-07 Thread Alan Mishler
Thank you, I'll post there. Regards, Alan On Wed, Aug 7, 2013 at 1:14 PM, Bert Gunter wrote: > I think it's fair to say that this should really be posted on the > mixed-model specific (especially using lme4) list r-sig-mixed-models > and not here. > > Cheers, > Bert > > On Wed, Aug 7, 2013 at

Re: [R] lmer( ) parameter estimates changing depending on dummy-coded reference level

2013-08-07 Thread Bert Gunter
I think it's fair to say that this should really be posted on the mixed-model specific (especially using lme4) list r-sig-mixed-models and not here. Cheers, Bert On Wed, Aug 7, 2013 at 9:01 AM, Alan Mishler wrote: > Hi everyone, > > I'm writing with a question about lmer( ) in the lme4 package.

[R] lmer( ) parameter estimates changing depending on dummy-coded reference level

2013-08-07 Thread Alan Mishler
Hi everyone, I'm writing with a question about lmer( ) in the lme4 package. I've searched around for answers and done quite a bit of experimentation with toy data sets to figure out my issue, and I haven't been able to resolve it. I'm running linear mixed effects models on a large, sparse dataset

Re: [R] lmer (multinomial response variable ~ fixed + (1|random), family='"multinomial" ???)

2013-05-30 Thread Ben Bolker
Maggie Wisniewska gmail.com> writes: > > Hello, > I am trying to run glmm to test the effect of the three fixed effects [AGE > (weaned vs. unweaned claf), LOCATION (zoo vs. park), MOTher's social status > (matriarch vs. nonmatriarch)] and one random effect [ID (12 different > calves of whom I h

[R] lmer (multinomial response variable ~ fixed + (1|random), family='"multinomial" ???)

2013-05-29 Thread Maggie Wisniewska
Hello, I am trying to run glmm to test the effect of the three fixed effects [AGE (weaned vs. unweaned claf), LOCATION (zoo vs. park), MOTher's social status (matriarch vs. nonmatriarch)] and one random effect [ID (12 different calves of whom I have multiple but unbalanced observations)] on the a

Re: [R] lmer with only random effect

2013-04-23 Thread Bert Gunter
What you want to do makes no sense. Would you care to explain why you think you want to do it? -- Bert On Tue, Apr 23, 2013 at 1:41 PM, li li wrote: > Dear all, > I want to fit a random effect model with only one random factor. I do not > want to > include the intercept term either. > The m

[R] lmer with only random effect

2013-04-23 Thread li li
Dear all, I want to fit a random effect model with only one random factor. I do not want to include the intercept term either. The model I using now is lmer(values ~ (1|lot), data=tmp) The results are as below. How do I take out the intercept term? Or if this is not possible for the lmer fu

Re: [R] lmer, p-values and all that

2013-04-03 Thread Nutter, Benjamin
titative Health Sciences   Cleveland Clinic  |  9500 Euclid Ave.  |  Cleveland, OH 44195  | (216) 445-1365 -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Ben Bolker Sent: Wednesday, March 27, 2013 10:34 PM To: David Winsemius Cc:

Re: [R] lmer effects-type plot?

2013-03-31 Thread Nicole Ford
lme4 package, to plot the fixed effects. See >> ?effect. >> >> I hope this helps, >> John >> >>> -Original Message- >>> From: r-help-boun...@r-project.org [mailto:r-help-bounces@r- >>> project.org] On Behalf Of Nicole Fo

Re: [R] lmer effects-type plot?

2013-03-31 Thread Nicole Ford
ed effects. See > ?effect. > > I hope this helps, > John > >> -Original Message- >> From: r-help-boun...@r-project.org [mailto:r-help-bounces@r- >> project.org] On Behalf Of Nicole Ford >> Sent: Sunday, March 31, 2013 7:27 PM >> To: r-he

Re: [R] lmer effects-type plot?

2013-03-31 Thread John Fox
age- > From: r-help-boun...@r-project.org [mailto:r-help-bounces@r- > project.org] On Behalf Of Nicole Ford > Sent: Sunday, March 31, 2013 7:27 PM > To: r-help-r-project.org help > Subject: [R] lmer effects-type plot? > > hello, all. > > while i have a mcmc running, i am loo

[R] lmer effects-type plot?

2013-03-31 Thread Nicole Ford
hello, all. while i have a mcmc running, i am looking at the frequestist method of my model. i have never done HLM so i am looking for ways to plot them that might yeild something useful like dr. fox's effects plot package. this is my model, where dem is democracy ranked continuous 1:10, trsut

Re: [R] lmer, p-values and all that

2013-03-27 Thread Ben Bolker
On 13-03-27 10:10 PM, David Winsemius wrote: > > On Mar 27, 2013, at 7:00 PM, Ben Bolker wrote: > >> Michael Grant colorado.edu> writes: >>> Dear Help: >> >>> I am trying to follow Professor Bates' recommendation, quoted by >>> Professor Crawley in The R Book, p629, to determine whether I should

Re: [R] lmer, p-values and all that

2013-03-27 Thread Nicole Ford
i did find this for you, down towards the end, they discuss the anova method. i am on my way to a bayesian analysis/lmer is a step towards that- so i won't be doing anova. i can't be of much specific help with that question, but here you go. https://stat.ethz.ch/pipermail/r-sig-mixed-models/20

Re: [R] lmer, p-values and all that

2013-03-27 Thread Nicole Ford
i meant to add, i am not sure if an "example" lmer model woulf be helpful, since i can't see the OP. On Mar 27, 2013, at 10:13 PM, Nicole Ford wrote: > i literally just ran one. > > when i ran one of mine and the did summary(mod) i get the following: > >> mod <- lmer(dem ~ xbar + cpi + (1 | c

Re: [R] lmer, p-values and all that

2013-03-27 Thread Nicole Ford
i literally just ran one. when i ran one of mine and the did summary(mod) i get the following: > mod <- lmer(dem ~ xbar + cpi + (1 | country), data=wvsAB) > summary(mod) Linear mixed model fit by REML Formula: dem ~ xbar + cpi + (1 | country) Data: wvsAB AIC BIC logLik deviance REMLdev

Re: [R] lmer, p-values and all that

2013-03-27 Thread David Winsemius
On Mar 27, 2013, at 7:00 PM, Ben Bolker wrote: > Michael Grant colorado.edu> writes: > >> >> >> Dear Help: > >> I am trying to follow Professor Bates' recommendation, quoted by >> Professor Crawley in The R Book, p629, to determine whether I should >> model data using the 'plain old' lm func

Re: [R] lmer, p-values and all that

2013-03-27 Thread Ben Bolker
Michael Grant colorado.edu> writes: > > > Dear Help: > I am trying to follow Professor Bates' recommendation, quoted by > Professor Crawley in The R Book, p629, to determine whether I should > model data using the 'plain old' lm function or the mixed model > function lmer by using the syntax

[R] lmer, p-values and all that

2013-03-27 Thread Michael Grant
Dear Help: I am trying to follow Professor Bates' recommendation, quoted by Professor Crawley in The R Book, p629, to determine whether I should model data using the 'plain old' lm function or the mixed model function lmer by using the syntax anova(lmModel,lmerModel). Apparently I've not unde

Re: [R] lmer (LME4) and survey standard error

2013-03-09 Thread Ben Bolker
David Epstein umich.edu> writes: [snip] > I am using lmer (LME4) to build a model from data for 19 different > neighborhoods drawn, in part, from the American Communities Survey > (ACS). The ACS data is static while other variables change over the > five years under investigation. I am new to mi

[R] lmer (LME4) and survey standard error

2013-03-09 Thread David Epstein
Hello, I am using lmer (LME4) to build a model from data for 19 different neighborhoods drawn, in part, from the American Communities Survey (ACS). The ACS data is static while other variables change over the five years under investigation. I am new to mixed effects models and was hoping that some

Re: [R] lmer - BLUP prediction intervals

2013-02-05 Thread Ben Bolker
Daniel Caro gmail.com> writes: > > Dear all > > I have a model that looks like this: > > m1 <- lmer(Difference ~ 1+ (1|Examiner) + (1|Item), data=englisho.data) > > I know it is not possible to estimate random effects but one can > obtain BLUPs of the conditional modes with > > re1 <- ranef

[R] lmer - BLUP prediction intervals

2013-02-05 Thread Daniel Caro
Dear all I have a model that looks like this: m1 <- lmer(Difference ~ 1+ (1|Examiner) + (1|Item), data=englisho.data) I know it is not possible to estimate random effects but one can obtain BLUPs of the conditional modes with re1 <- ranef(m1, postVar=T) And then dotplot(re1) for the examiner

Re: [R] lmer model specification

2012-11-21 Thread Ben Bolker
Roy comcast.net> writes: > > I am running version 2.15.2 64 bit version on 64 bit Windows 7. I have a > data set with the following structure: > Fixed Effect: locationFact > Random Effects: datefact, timefact nested in datefact, interactions of > datefact and timefact with locationFact I th

[R] lmer model specification

2012-11-21 Thread Roy
I am running version 2.15.2 64 bit version on 64 bit Windows 7. I have a data set with the following structure: Fixed Effect: locationFact Random Effects: datefact, timefact nested in datefact, interactions of datefact and timefact with locationFact I fit the model with the latest version of lm

Re: [R] R lmer & SAS glimmix

2012-11-12 Thread Bert Gunter
It's due to the different coding of contrasts. Post to R-sig-mixed models for a fuller explanation (though it has nothing to do with mixed models; the same would happen with lm) or search on a suitable phrase (e.g. contrast coding in SAS versus R) in R archives or via google etc. -- Bert On Mon,

[R] R lmer & SAS glimmix

2012-11-12 Thread Sophie GUERIN
Hi, I am trying to fit a model with lmer in R and proc glimmix in SAS. I have simplified my code but I am surprised to see I get different results from the two softwares. My R code is : lmer(y~age_cat + (1|cat),data=fic,family=binomial(link = "logit"), NaGQ=1) My SAS code is : ods output Gl

Re: [R] LMER vs PROC MIXED estimates

2012-11-07 Thread David Winsemius
On Nov 6, 2012, at 11:38 PM, sandip1006 wrote: > Hi David, > > Thanks for the reply. sorry for typo in the R script ...what I meant to > write was > testdata <- read.csv("adstest.csv",header=TRUE,sep=",") > attach(testdata) > library(lme4) > options(contrasts = c(factor = "contr.SAS",ordered

Re: [R] LMER vs PROC MIXED estimates

2012-11-07 Thread sandip1006
Hi David, Thanks for the reply. sorry for typo in the R script ...what I meant to write was testdata <- read.csv("adstest.csv",header=TRUE,sep=",") attach(testdata) library(lme4) options(contrasts = c(factor = "contr.SAS",ordered = "contr.poly")) lmm.2=lmer(y~X1+X2+X3 + (X2|Geography),REML

Re: [R] LMER vs PROC MIXED estimates

2012-11-06 Thread David Winsemius
On Nov 6, 2012, at 7:00 PM, sandip1006 wrote: > Hi experts, > > I have just about started to use R (after using SAS for more than 5 years) > and still finding my way...I have been trying to replicate PROC MIXED > results in LMER but noticed that the estimates are coming different. Better practi

[R] LMER vs PROC MIXED estimates

2012-11-06 Thread sandip1006
Hi experts, I have just about started to use R (after using SAS for more than 5 years) and still finding my way...I have been trying to replicate PROC MIXED results in LMER but noticed that the estimates are coming different. My SAS code is as follows (trying to randomise X2 and Intercept): PR

Re: [R] lmer t value for 3 levels of fixed factor

2012-07-27 Thread Ben Bolker
Obermeier Andrew me.com> writes: > Hello, I just joined this list today, so am worried about proper > protocol, but would like to post a question about lme4. You should probably join/post this question to the r-sig-mixed-models r-project.org mailing list, which is specialized for those topic

[R] lmer t value for 3 levels of fixed factor

2012-07-26 Thread Obermeier Andrew
Hello, I just joined this list today, so am worried about proper protocol, but would like to post a question about lme4. In Baayen, Davidson, and Bates (2008), Mixed-effects modeling with crossed random effects for subjects and items, the authors describe steps for a Latin Square Design (p. 40

Re: [R] Lmer coef table

2012-06-10 Thread Özgür Asar
Dear Andrew, latextable function under the R package miscFuncs might help you preparing a LATEX table in R. For the usage, see an example on the webpage of the author of the package at http://www.lancs.ac.uk/staff/taylorb1/ Best Ozgur -- View this message in context: http://r.789695.n4.nabble

Re: [R] Lmer coef table

2012-06-10 Thread arun
12 7:57 PM Subject: [R] Lmer coef table Hi all, I would like to print the results of my lmer model (lme4) into a table that can be sweaved into Latex. I am aware that xtable does not support lme objects. I have tried the suggestions in the following thread: https://stat.ethz.ch/pipermail/r-help/201

[R] Lmer coef table

2012-06-10 Thread drewmac
Hi all, I would like to print the results of my lmer model (lme4) into a table that can be sweaved into Latex. I am aware that xtable does not support lme objects. I have tried the suggestions in the following thread: https://stat.ethz.ch/pipermail/r-help/2010-February/229002.html: I have succes

Re: [R] lmer function in R

2012-06-10 Thread Ben Bolker
Gary Dong gmail.com> writes: > I'm estimating a two-level regresion model but having difficuly in finding > a good R syntax example. > > Let me use an example to explain what I'm doing. The dependent variable is > math score (mathscore). Predictors are at two levels. At the student level, > they

[R] lmer function in R

2012-06-09 Thread Gary Dong
Dear R users, I'm estimating a two-level regresion model but having difficuly in finding a good R syntax example. Let me use an example to explain what I'm doing. The dependent variable is math score (mathscore). Predictors are at two levels. At the student level, they are household income (hinc)

Re: [R] lmer - error message

2012-02-17 Thread Joshua Wiley
Hi Sean, Thanks for the data. Your first problem is that Age is a factor with 14 levels. Second, Year is a factor with 16 levels. Now consider what interactions of these will be---factors with a huge number of levels, exceeding what is reasonable to fit to your size of data. I included inline

Re: [R] lmer - error message

2012-02-17 Thread ilai
I think my problem is that I can't >> incorporate the 'lake' variable in a fixed-effect interaction because it is >> only has one binary observation.  But I don't know what to do to be able to >> fit this model.  Any help would be greatly appreciated! >> -Sean > >  In principle you should be able

Re: [R] lmer - error message

2012-02-17 Thread Ben Bolker
Sean Godwin gmail.com> writes: > > Hi all, > > I am fairly new to mixed effects models and lmer, so bear with me. > > Here is a subset of my data, which includes a binary variable (lake (TOM or > JAN)), one other fixed factor (Age) and a random factor (Year). > lake FishID Age Increment Year

[R] lmer - error message

2012-02-16 Thread Sean Godwin
Hi all, I am fairly new to mixed effects models and lmer, so bear with me. Here is a subset of my data, which includes a binary variable (lake (TOM or JAN)), one other fixed factor (Age) and a random factor (Year). lake FishID Age Increment Year 1 TOM 1 1 0.304 2007 2 TOM

Re: [R] lmer with spatial and temporal random factors, not nested

2012-02-07 Thread Ben Bolker
Marte Lilleeng gmail.com> writes: > > Hi, I am new to this list. The r-sig-mixed-mod...@r-project.org mailing list would be more appropriate for this question -- please direct any further questions there ... > I have a question regarding including both spatial and temporal random > factors i

[R] lmer with spatial and temporal random factors, not nested

2012-02-06 Thread Marte Lilleeng
Hi, I am new to this list. I have a question regarding including both spatial and temporal random factors in lmer. These two are not nested, and an example of model I try to fit is model1<-lmer(Richness~Y+Canopy+Veg_cm+Treatment+(1|Site/Block/Plot)+(1|Year), family=poisson, REML=FALSE), where rich

[R] lmer function bug

2011-12-27 Thread Cheryl Johnson
Hello, When I make certain values greater with the lmer function, variance components that I expect to give a certain value are switched from how I expect them to be. Has anyone else had this problem? Thanks [[alternative HTML version deleted]] __

Re: [R] Lmer plot help

2011-09-04 Thread Andrew MacFarlane
Thanks for that Michael. My model code, and resultant output, is: model = lmer(supportive ~ Voice + question +(1|participant), data=voice, family="binomial") #Fixed effects: #Estimate Std. Error z value Pr(>|z|) #(Intercept) 1.3981 0.2140 6.534

Re: [R] Lmer plot help

2011-09-04 Thread Michael Friendly
On 9/3/2011 7:52 PM, drewmac wrote: Hello all I'm running the lme4 package on my binomial data, and I'm happy with the model and the resultant plot. However, I'd like to plot my table data, which has: two IVs, and one DV. You can see an example below, where 'attractive' = question (IV), male =

[R] Lmer plot help

2011-09-03 Thread drewmac
Hello all I'm running the lme4 package on my binomial data, and I'm happy with the model and the resultant plot. However, I'd like to plot my table data, which has: two IVs, and one DV. You can see an example below, where 'attractive' = question (IV), male = condition(IV/predictor) and no/yes = a

Re: [R] lmer() computational performance

2011-06-29 Thread Ben Bolker
zubin bellsouth.net> writes: > > Hello, running a mixed model in the package LME4, lmer() > > Panel data, have about 322 time periods and 50 states, total data set is > approx 15K records and about 20 explanatory variables. Not a very > large data set. > > We run random intercepts as well a

[R] lmer() computational performance

2011-06-29 Thread zubin
Hello, running a mixed model in the package LME4, lmer() Panel data, have about 322 time periods and 50 states, total data set is approx 15K records and about 20 explanatory variables. Not a very large data set. We run random intercepts as well as random coefficients for about 10 of the variab

[R] lmer: How to plot a spline from function

2011-06-16 Thread Caro
Hi, my problem sounds simple but I've been trying and looking for a solution, but just can not find out how to solve it. I have a dataset and want to do a GAM with binomial link function, random effects (for individuals as there are severeal measurements for everyone) and a time-spline. For thi

Re: [R] lmer with 2 random effects with only two levels

2011-05-19 Thread Daniel Malter
What you should and can do depends on the expectations you have regarding the correlation structure of the data and is limited by your degrees of freedom. For example, what is wrong about: reg<-lmer(response~femaleset+treatment+(1|group)) ? This assumes that there are constant group effects on

[R] lmer with 2 random effects with only two levels

2011-05-19 Thread gmd
Dear all, I am analysing a data set based on 6 groups of individuals. Each group is observed for 10 days. 5 days with one manipulation 5 days with another manipulation. I therefore have 6 replicate groups (n=6) each with one mean measurement for manipulation A and manipulation B. Each group con

[R] lmer, MCMCsamp and ranef samples?

2011-02-19 Thread Jukka Koskela
I really hope sombody could help me with the following, I'm having problems accessing the random effect samples following the example on MCMCsamp: (fm1 <- lmer(Reaction ~ Days + (1|Subject) + (0+Days|Subject), sleepstudy)) set.seed(101); samp0 <- mcmcsamp(fm1, n = 1000, saveb=TRUE) str(samp

Re: [R] Lmer binomial distribution x HLM Bernoulli distribution

2011-02-01 Thread Douglas Bates
On Tue, Feb 1, 2011 at 10:51 AM, Luana Marotta wrote: > Dear R-users, > I'm running a lmer model using the lme4 package. My dependent variable is > dichotomous and I'm using the "binomial" family. The results > are slightly different from the HLM results based on a Bernoulli > distribution. I rea

[R] Lmer binomial distribution x HLM Bernoulli distribution

2011-02-01 Thread Luana Marotta
Dear R-users, I'm running a lmer model using the lme4 package. My dependent variable is dichotomous and I'm using the "binomial" family. The results are slightly different from the HLM results based on a Bernoulli distribution. I read that a Bernoulli distribution is an extension of a binomial dis

Re: [R] lmer() vs. lme() gave different variance component estimates

2010-09-21 Thread Douglas Bates
.11.1 tcltk_2.11.1  tools_2. > > ) > > > >>> >>> Whoever suggested using the verbose option to see the progress of the >>> iterations has the right idea. >>> >>> >>> On Mon, Sep 20, 2010 at 2:50 PM, array chip wrote: >>>>

Re: [R] lmer() vs. lme() gave different variance component estimates

2010-09-21 Thread Peter Dalgaard
chip wrote: >>> Thank you Peter and Ben for your comments. >>> >>> John >>> >>> >>> - Original Message >>> From: Peter Dalgaard >>> To: array chip >>> Cc: r-help@r-project.org; r-sig-mixed-mod...@r-project

Re: [R] lmer() vs. lme() gave different variance component estimates

2010-09-21 Thread Douglas Bates
ts. >> >> John >> >> >> - Original Message >> From: Peter Dalgaard >> To: array chip >> Cc: r-help@r-project.org; r-sig-mixed-mod...@r-project.org >> Sent: Mon, September 20, 2010 12:28:43 PM >> Subject: Re: [R] lmer() vs.

Re: [R] lmer() vs. lme() gave different variance component estimates

2010-09-21 Thread Douglas Bates
ter Dalgaard > To: array chip > Cc: r-help@r-project.org; r-sig-mixed-mod...@r-project.org > Sent: Mon, September 20, 2010 12:28:43 PM > Subject: Re: [R] lmer() vs. lme() gave different variance component estimates > > On 09/20/2010 08:09 PM, array chip wrote: >> Thank you Pe

Re: [R] lmer() vs. lme() gave different variance component estimates

2010-09-20 Thread array chip
Thank you Peter and Ben for your comments. John - Original Message From: Peter Dalgaard To: array chip Cc: r-help@r-project.org; r-sig-mixed-mod...@r-project.org Sent: Mon, September 20, 2010 12:28:43 PM Subject: Re: [R] lmer() vs. lme() gave different variance component estimates

Re: [R] lmer() vs. lme() gave different variance component estimates

2010-09-20 Thread Peter Dalgaard
), and I would expect glht() to give meaningful results. Do check the residuals for at least approximate normality, though. > > Thank you very much! > > John > > > > > > - Original Message > From: Peter Dalgaard > To: array chip > Cc: r-hel

Re: [R] lmer() vs. lme() gave different variance component estimates

2010-09-20 Thread array chip
org; r-sig-mixed-mod...@r-project.org Sent: Sat, September 18, 2010 1:35:45 AM Subject: Re: [R] lmer() vs. lme() gave different variance component estimates For a nested design, the relation is quite straightforward: The residual MS are the variances of sample means scaled to be comparable with th

Re: [R] lmer() vs. lme() gave different variance component estimates

2010-09-18 Thread Peter Dalgaard
On 09/17/2010 10:50 PM, array chip wrote: > > > Thank you Peter. Actually 3 people from mixed model mailing list tried my > code > using lmer(). They got the same results as what I got from lme4(). So they > couldn't replicate my lmer() results: > > Random effects: > Groups NameVari

Re: [R] lmer() vs. lme() gave different variance component estimates

2010-09-17 Thread Kevin Wright
Residuals 480 9 0.01875 > > As can be seen, thr within subject variance estimate (0.01875) is the same > between aov, lmer and lme. But I am not sure how to relate results between > aov > and lmer/lme for the other 2 variance components (id and eye%in%id). > > Thanks &

Re: [R] lmer() vs. lme() gave different variance component estimates

2010-09-17 Thread array chip
: Fri, September 17, 2010 1:05:27 PM Subject: Re: [R] lmer() vs. lme() gave different variance component estimates On 09/17/2010 09:14 PM, array chip wrote: > 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 ma

Re: [R] lmer() vs. lme() gave different variance component estimates

2010-09-17 Thread Peter Dalgaard
On 09/17/2010 09:14 PM, array chip wrote: > 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

[R] lmer() vs. lme() gave different variance component estimates

2010-09-17 Thread array chip
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

Re: [R] lmer output

2010-09-10 Thread Ben Bolker
unibas.ch> writes: > I have a question regarding an output of a binomial lmer-model. > The model is as follows: > lmer(y~diet * day * female + (day|female),family=binomial) A reproducible example would always be nice. > The corresponding output is: > Generalized linear mixed model fit by th

Re: [R] lmer fixed effects, SE, t . . . and p

2010-09-10 Thread Gavin Simpson
Gavin Simpson > To: John Sorkin > Cc: r-help@r-project.org; Bert Gunter > Sent: Fri, September 10, 2010 2:05:37 AM > Subject: Re: [R] lmer fixed effects, SE, t . . . and p > > On Thu, 2010-09-09 at 23:40 -0400, John Sorkin wrote: > > Bert, > > I appreciate you com

Re: [R] lmer fixed effects, SE, t . . . and p

2010-09-10 Thread array chip
But as far as I know, profile() seems to be de-activated in the lme4 package. - Original Message From: Gavin Simpson To: John Sorkin Cc: r-help@r-project.org; Bert Gunter Sent: Fri, September 10, 2010 2:05:37 AM Subject: Re: [R] lmer fixed effects, SE, t . . . and p On Thu, 2010-09

[R] lmer output

2010-09-10 Thread Denis . Aydin
Hi I have a question regarding an output of a binomial lmer-model. The model is as follows: lmer(y~diet * day * female + (day|female),family=binomial) The corresponding output is: Generalized linear mixed model fit by the Laplace approximation Formula: y ~ diet * day * female + (day | female)

Re: [R] lmer fixed effects, SE, t . . . and p

2010-09-10 Thread Gavin Simpson
On Thu, 2010-09-09 at 23:40 -0400, John Sorkin wrote: > Bert, > I appreciate you comments, and I have read Doug Bates writing about p > values in mixed effects regression. It is precisely because I read > Doug's material that I asked "how are we to interpret the estimates" > rather than "how can we

Re: [R] lmer fixed effects, SE, t . . . and p

2010-09-09 Thread John Sorkin
Bert, I appreciate you comments, and I have read Doug Bates writing about p values in mixed effects regression. It is precisely because I read Doug's material that I asked "how are we to interpret the estimates" rather than "how can we compute a p value". My question is a simple question whose

Re: [R] lmer fixed effects, SE, t . . . and p

2010-09-09 Thread Mitchell Maltenfort
Try coef(summary(fit3)) On Thu, Sep 9, 2010 at 11:00 PM, John Sorkin wrote: > windows Vista > R 2.10.1 > > > (1) How can I get the complete table of for the fixed effects from lmer. As > can be seen from the example below, fixef(fit2) only give the estimates and > not the SE or t value > >> fi

[R] lmer fixed effects, SE, t . . . and p

2010-09-09 Thread John Sorkin
windows Vista R 2.10.1 (1) How can I get the complete table of for the fixed effects from lmer. As can be seen from the example below, fixef(fit2) only give the estimates and not the SE or t value > fit3<- lmer(y~time + (1|Subject) + (time|Subject),data=data.frame(data)) > summary(fit3) Linear

Re: [R] lmer() causes segfault

2010-08-25 Thread Bertolt Meyer
Dennis, just wow. Thank you so much. I knew it was something trivial - in this case the variable type of the of the grouping variables. However, something as trivial as this should not throw a segfault IMHO. I tried subscribing to R-sig-mixed this morning, but the corresponding mail serve

Re: [R] lmer() causes segfault

2010-08-25 Thread Dennis Murphy
Hi: Let's start with the data: > str(test.data) 'data.frame': 100 obs. of 4 variables: $ StudentID: num 17370 17370 17370 17370 17379 ... $ GroupID : num 1 1 1 1 1 1 1 1 1 1 ... $ Time : num 1 2 3 4 1 2 3 4 1 2 ... $ Score: num 76.8 81.8 89.8 92.8 75.9 ... Both StudentID and

Re: [R] lmer() causes segfault

2010-08-25 Thread Bertolt Meyer
Ben Bolker gmail.com> writes: Bertolt Meyer sozpsy.uzh.ch> writes: Hello lmer() - users, A call to the lmer() function causes my installation of R (2.11.1 on Mac OS X 10.5.8) to crash and I am trying to figure out the problem. [snip snip] detach("package:nlme") library(lme4) mod1 <-

Re: [R] lmer() causes segfault

2010-08-23 Thread Ben Bolker
Bertolt Meyer sozpsy.uzh.ch> writes: > > Hello lmer() - users, > > A call to the lmer() function causes my installation of R (2.11.1 on > Mac OS X 10.5.8) to crash and I am trying to figure out the problem. [snip snip] > detach("package:nlme") > library(lme4) > > mod1 <- lmer(performance

[R] lmer() causes segfault

2010-08-23 Thread Bertolt Meyer
Hello lmer() - users, A call to the lmer() function causes my installation of R (2.11.1 on Mac OS X 10.5.8) to crash and I am trying to figure out the problem. I have a data set with longitudinal data of four subsequent performance measures of 1133 individuals nested in 88 groups. The data

Re: [R] lmer() with no intercept

2010-06-14 Thread Meyners, Michael
om me. HTH, Michael -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of array chip Sent: Saturday, June 12, 2010 1:07 To: r-help@r-project.org Subject: [R] lmer() with no intercept Hi, I asked this before, but haven't got any response. S

Re: [R] lmer() with no intercept

2010-06-11 Thread Gabor Grothendieck
Try a different example: set.seed(123) N <- 24 k <- 6 x <- 1:N f <- rep(rnorm(k, 0, 4), each = N/k) e <- rnorm(N) y <- x + f + e fac <- gl(k, N/k) library(lme4) fm1 <- lmer(y ~ x + (1|fac)); fm1 fm0 <- lmer(y ~ x -1 + (1|fac)); fm0 plot(y, fitted(fm0)) abline(a = 0, b = 1, lty = 2, col = "blue"

[R] lmer() with no intercept

2010-06-11 Thread array chip
Hi, I asked this before, but haven't got any response. So would like to have another try. thanks for help. Also tried twice to join the model mailing list so that I can ask question there, but still haven't got permission to join that list yet. === Hi, I am wondering how I can spec

[R] lmer() with no intercept

2010-06-03 Thread array chip
Hi, I am wondering how I can specify no intercept in a mixed model using lmer(). Here is an example dataset attached ("test.txt"). There are 3 workers, in 5 days, measured a response variable "y" on independent variable "x". I want to use a quadratic term (x2 in the dataset) to model the relat

  1   2   3   >