lme() is the function for estimating Linear Mixed Effects models in the nlme package for the R project for statistical computing. For general questions about mixed effects models, use the [mixed-effect] tag.

learn more… | top users | synonyms

0
votes
0answers
19 views

How can I extract a residual variance-covariance matrix in lme?

I have been using MCMCglmm in R to fit bivariate (two response traits) mixed models in R, but now I need to move to lme to account for temporal autocorrelation of the residuals. In MCMCglmm I can fit ...
1
vote
0answers
20 views

Mixed Effects model with block and autocorrelated fixed effect

I am trying to run a mixed effect model on soils data that were collected at two locations in a randomized complete block design (4 blocks). I am interested in the effect of location and depth (below ...
0
votes
0answers
28 views

corARMA specification in a date*DayNight model

I'm working on a model of animal movement speed as a function of date and day/night. For each animal (50 individuals), I have 2 values for each date an animal was present - a day value and a night ...
0
votes
0answers
19 views

Different results in a mixed model when compared with raw data

I ran a model with reaction time as my DV and PWI Condition (2 levels) as one of the fixed factors. I used contr.sum for all fixed factors. I ran the following model to look for differences in ...
5
votes
1answer
136 views

Mixed effects - how to model random scaling of observations?

I'm analyzing a three-way mixed linear model using lmer: Y ~ Factor1 * Factor2 * Factor3 + (1|sensor) However, different sensors have different gains, uniformly ...
1
vote
1answer
56 views

Which model of lm/lme to believe?

I have a data set of height values for several individuals of several species in 2 different conditions. Not all the species are found in the 2 conditions. I want to compare height values between ...
2
votes
1answer
49 views

split-split plot design with unbalanced repeated measures in lme4 or nlme (SAS translation)

I am sorry if this answer has been answered before but most answers here (e.g. here, or here ) do not really adress my issue (or maybe I just do not see correctly how they do. I want to use a (linear) ...
0
votes
0answers
37 views

replication of findings in regression models

Let's say we have a dataset for which we constructed a multiple linear regression model and obtained a particular set of $\beta$ coefficients and their significance values. Now, we want to replicate ...
1
vote
2answers
45 views

Can we use weights in lme as a covariable?

This question might be a duplicate, but a colleague and I have trouble understanding previous answers about the use of weights in lme. So in simple terms: We have an experimental design with 2 ...
0
votes
0answers
15 views

unequal item numbers

I am looking at whether reaction time scores for picture naming (DV) is influenced by age (younger vs older adults), word type (cognates vs. non-cognates) and language (English vs. French). However, I ...
0
votes
0answers
18 views

LME, t-test and glht

I am doing some light simulations, but came across the following problem. I cannot obtain the same p-value as a paired t-test as it does for multiple comparison and LME. ...
0
votes
0answers
32 views

Concerns regarding correlation structures and random variance using lme

I’m modeling some variables repeatedly measured over a three months period for a total of 300 individuals. These variables (e.g. activity) were measured at three different time scales: daily (90 ...
0
votes
0answers
37 views

I keep getting the error “iteration limit reached” when using LME

I'm trying to model the effect of island size and island isolation on species richness using a LME. However I'm getting this error message "iteration limit reached". ...
0
votes
0answers
19 views

Linear mixed-effect models for variables with unequal size

as a biologist I am currently analyzing data where variable sizes are unequal but nevertheless dependent on each other. In my specific case, I am aiming to test with a linear mixed-effect model ...
0
votes
0answers
34 views

Should I include weights in LME?

I have two case studies where I am looking at the influence of a trait (trait A) on mortality (m) of trees and seedlings. Following your comments on ...
1
vote
0answers
51 views

Piecewise HLM with nlme [closed]

I have two time periods of interest and four observation points(0 months, 4 months, 12 months, 16 months) for my subjects. The first time period of interest is between observation 1 and observation 3. ...
0
votes
0answers
25 views

Degrees of Freedom of Cross-Level Interactions Terms in LME/LMER models

I am currently working on a hierarchical linear model using a dataset with variables on two levels. Level 1 variables have roughly 90000 observations and level 2 variables 141 observations. ...
0
votes
0answers
16 views

Correlated subjects in linear mixed model

I have a continuous variable that I want to model using linear mixed model. Goal is to measure two effects related to city and data source from which the variable came. The target variable is in fact ...
0
votes
0answers
49 views

How to test fixed vs. random effects for lme in R?

I have ran two lme mixed effects models in R, both using the same fixed effects variables but each with a different random effect variable. My reviewer has said I should use the Hausman test to ...
0
votes
0answers
15 views

Convergence error with lme for 2 genes out of 4608

I am using lme to eradicate spot effects from microarrays for 8 independent subjects and 4608 genes. Whenever I am trying to run "lme" it gives an error which is below ...
0
votes
1answer
108 views

“Error during wrapup: the leading minor of order 2 is not positive definite” when trying to use LME with random slopes

This works fine: lme(fixed=target~target_projection, random= ~ 1|CLINICIAN_USER_ID, data=study_pop) But if I try to let the slopes vary: ...
1
vote
0answers
57 views

How do I fit a linear mixed model in R with autocorrelation, when the effect of time is of no interest?

I am attempting to fit a linear mixed model with the lme function using R. My data involve repeated measures, but the effect of time is not of interest to me, so I don't want to include it as a fixed ...
2
votes
1answer
232 views

lme summary() interpretation

Need some help interpreting the summary() -function results. I am running a lme from the package nlme in R. I have a simple ...
0
votes
1answer
160 views

Should I include this fixed effect? lme4 likelihood ratio test and lmerTest anova disagree

I have a mixed-effects model with two fixed effects and one random effect (group membership) estimated using lme4. log_dv ~ iv1 + iv2 + (1 | group) I want to ...
0
votes
1answer
25 views

Trouble getting LME in R to work with within-groups (repeated Measures) data

I’m having trouble figuring out how to apply the LME function to a set of data. What I have is a list of Stores and their respected customer count, by week, with various external factors for each ...
2
votes
1answer
190 views

Using B-splines within a linear mixed-effects model in R

I am using linear mixed-effect model (run with the lme() function in the nlme package in R) that has one fixed effect, one ...
0
votes
0answers
36 views

glht on gamm results

I have a GAMM model that has both an LME and a GAM part. I have used glht (multcomp) to check significant differences through the code: ...
2
votes
0answers
71 views

Multiple comparisons for variance structure in R lme fit

How can I compare variances for different levels of a factor in a mixed effect model? I'm fitting a mixed effects model (in R using the ...
0
votes
0answers
100 views

R code for standardized coefficents and model effect size using nlme

I have fit a longitudinal random effects model using nlme and I prefer nlme because I can get p-values. While working with a ...
0
votes
0answers
23 views

Variance component analysis nlme

Is there a way to carry a variance component analysis using nlme or lme4 packages and how would I calculate the percentage of variance that is attributable to the random effects? For example, my ...
0
votes
0answers
36 views

What type of post hoc test does a LME use by default?

I need to know what type of post hoc test a LME model is using in R, by default? Is it Tukey? And is the alpha modified?
0
votes
1answer
328 views

Post Hoc test after lme [closed]

I am trying to run a Post Hoc test (glht) after a linear mixed model (lme) in R. I was ...
0
votes
0answers
80 views

Repeated measures linear mixed effects model

I am working with trees that were fertilized in a full factorial design (N x P x K) in plots that are replicated four times. I currently have a mixed effects model with this structure: ...
0
votes
0answers
38 views

Partial derivative from lme or lm object

I'm looking for an R package, or another approachable way in R to obtain the first partial derivative of choice from an lm or lme object. I'm aware of http://stats.stackexchange.com/a/8253/13758 but ...
1
vote
0answers
40 views

Assumptions for nlme

I want to analyze a repeated measure design with two independent variables (var1, var2) where the subjects had to solve three ...
0
votes
0answers
86 views

Hierarchical weighted linear regression through the origin and varying slopes within groups

I am trying to fit a hierarchical linear regression model. My data includes samples with 10 different classes, and samples have varying numbers of data points (from 1 to ~1000). I want to fit a ...
0
votes
0answers
22 views

Standard errors of estimates in multi factorial LMEM

This question may already be well-answered as it seems relatively straight forward, but my search of existing posts has failed... apologies if it is redundant. I am building a linear mixed effects ...
4
votes
1answer
333 views

What statistical test is performed by summary(glht(model, linfct=mcp(factor=“Tukey”)), test=adjusted(type=“none”))?

I have data that I have fit using lme with the following structure (Subject is implemented as a random effect in order to account for multiple paired comparisons): ...
2
votes
0answers
395 views

Accounting for heteroskedasticity in lme linear mixed model?

I have a data set where I measured the number of molecules (M) present in cells as a function of drug (with or without) and days of treatment (5 timepoints). I repeated the experiment 3 times, with ...
1
vote
0answers
154 views

Mixed and random effect model with multiple crossed random effects in lme4 vs nlme

I am trying to fit a few models as follows for my data of observations recorded from $p$ genotypes planted in $n$ locations for $m$ years. The aim is to estimate BLUPs finally. $$Y_{ijk} = \mu + G_i ...
0
votes
0answers
46 views

How to interpret 3 main effects when an interaction exists for only two of the variables?

I've been searching for interpretation guidance regarding the below problem, but all the resources I've seen have been fully crossed (i.e., all variables included in the interaction term). Below is a ...
1
vote
1answer
376 views

lme() with several within and between (categorical and continuous) subject factors

I am currently trying to analyse data from an experiment of mine and I have done some searching for instructions on the usage of the lme() function for R, since I am looking to analyse my data with a ...
1
vote
0answers
46 views

Estimated random effects correlation of 1 when fitting a random intercept model using lme

I am trying to fit the linear random effects model: $y_{ijk}=\theta_{ij}+\epsilon_{ijk},$ where $\theta_{ij}$ is a random effect. I assume the random effects and error distributions are normal. ...
0
votes
0answers
32 views

How to calculate confidence intervals using gamm?

I have a problem calculating confidence intervals from a gamm model. My data looks like this: As you can see, these are longitudinal data of subjects in groups (Each subject appears only in one ...
0
votes
0answers
92 views

Random effect model result of R and JMP

I have two groups of people, namely A and B. We have the hourly mean heart rate for 45-80 hrs, length differed by individual. We are interested in the group*time effect on the heart rate. Since I have ...
1
vote
0answers
157 views

including interactions in a mixed linear model in R (lme)

I'm trying to test for the effect of soil moisture on transpiration rates. I have plot-level data for 18 plots in 6 different stands of trees (3 plots x 6 stands). I want to treat "stand" as a random ...
0
votes
0answers
48 views

Intuitive feel in mixed effect models

This is something I have been thinking about for sometime. Consider the random effects model $y= Zu + e$ where $u \sim N(0, \sigma^{2}I)$ and $ e \sim N(0, \epsilon^{2}I)$ I now want to compare 2 ...
3
votes
1answer
404 views

Multivariate model in lme() with independent random effect, similar to MCMCglmm

I would like to specify a multivariate model with lme with a random effect for group which is independent across variables. I found this post, which explains that ...
0
votes
0answers
108 views

allowing for different variances between groups versus allowing for random slopes in lme

I have a data set that looks like this: Genotype Condition Trait A 1 0.0007 B 1 0.005 A 2 0.0003 B 2 ...
0
votes
0answers
31 views

differences between different notations in mixed effects model

I have never been so confused in my life. Could anyone please tell me what is the difference between the following mixed effects models: ...