lmer (& siblings glmer & nlmer) are functions in the R package lme4 that fit mixed effects models (ie, models that include fixed & random effects). These models can be non-linear in the sense that the dependent variable is transformed by a non-linear function (eg, logistic or log) to accommodate ...

learn more… | top users | synonyms

2
votes
2answers
26 views

getting degrees of freedom from lmer

I've fit an lmer model with the following (albeit made up output): ...
0
votes
0answers
19 views

Linear mixed model with two correlated dependent variables

I'm using the swissmunicipalities dataset in the package sampling of R. I consider two correlated dependent variables, the population between 40 and 65 (Pop4065), and the population aged 65 or more ...
0
votes
1answer
36 views

When the dependent variable and random effects 'overlap' in mixed effects models

I have a dependent variable that depends on one of my random effects, as such: ...
0
votes
0answers
32 views

Fitting a model

I have a problem with fitting a model in lmer. My DV is reaction time to picture naming which is a continuous variable. I have three IV which are categorical. The first factor is TMS condition: either ...
0
votes
1answer
20 views

Post-hoc testing in multcomp::glht for mixed-effects models (lme4) with interactions

I am new to CrossValidated, so if there is a better way for me to format or ask my question, please feel free to comment. I am performing post-hoc tests on a linear mixed-effects model in R (package ...
0
votes
0answers
11 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
13 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
1answer
40 views

How to translate percentage decline into a regression slope?

I want to model a negative relationship of count/binary data over 10 years with a known value for the decline rate (in percentage). However, I have problems in calculating the correct slope value for ...
1
vote
0answers
35 views

Use lmer to test main effects and interaction

I have to solve a problem using a linear mixed model (lmer). Six subjects performed two tests, (test1, ...
0
votes
1answer
29 views

lmer syntax for a two-way model with one fixed and one random factor [closed]

Please could anyone tell me if my R code is correct? I have a two-way model with one fixed factor, habitat, and one random factor, site. The code I am using is: ...
0
votes
0answers
12 views

Multilevel model with multiple level 2 variables

I am estimating a model where I want to know how the performance will vary across the students as influenced by their individual characteristics and aspects of their schools. Performance is the ...
3
votes
1answer
44 views

Hypothesis testing: If not a p-value in mixed effect models, then what?

I've been working on a messy, repeated measures data set of endocrine data looking at a small group of variables (after eliminating several uninteresting contenders in exploratory data analysis), each ...
0
votes
0answers
55 views

Model averaging predictions from lmer models

I am trying to model average predictions (not betas) and estimate confidence intervals from linear mixed models run with lme4::lmer. I have experimented with functions in the MuMIn and AICcmodavg ...
1
vote
0answers
28 views

What does (1|g1/g2) mean in a lmer formula?

What does this formula mean? lmer(y ~ (1|g1/g2)) equivalently: lmer(y ~ (1|g1) + (1|g1:g2) According to the PDF that I ...
1
vote
1answer
85 views

Correct glmer distribution family and link for a continuous zero-inflated data set

Data set details: Zeros are "real" (volume) Data set is heavily left skewed (even when zeros are excluded) Response is continuous (volume) Can anyone recommend a distribution family and link that I ...
1
vote
0answers
38 views

Comparing mixed-effects and fixed-effects models

Given three variables, y and x, which are positive continuous, and z, which is categorical, ...
0
votes
0answers
46 views

Error when using mixed function in afex package on GLMM

I have been using lme4 in order to fit an overdispersion model and GLMM to my data as shown below. This seems to work fine. ...
1
vote
0answers
13 views

How to include questionnaire data with behavioral counts in lmer() maximal logistic regression model?

I’m using a maximal logistic regression model to analyze some data. I would like to keep using this technique if possible, just include more data in the model. The main data I’m looking at is counts ...
4
votes
0answers
78 views

R lmerTest and Tests of Multiple Random Effects

I'm curious about how lmerTest package in R, specifically the "rand" function, handles tests of random effects. Consider the example from the lmerTest pdf on CRAN that uses the built in "carrots" ...
3
votes
1answer
67 views

lme4: random effects

I have a simulated data set of 4 repeated measurements (measure) for 5 subjects (subj), 20 trials (trl) each. I am trying to fit a model with random slopes for age category with subject and trials ...
0
votes
1answer
36 views

Material difference between Mixed Effects Model and normal Linear Model

I have a question about normal linear models vs mixed models. Say I'm predicting prices for certain products, and I know two things: store and brand: In a linear model (lm), this would be: ...
0
votes
1answer
42 views

Two factor linear mixed effect model with multiple slopes (lmer)

I have data with two factors TREATMENT and TIME both with two levels and a dependent variable RATIO. Besides random intercept for subjects, I want to specify random slopes for both of the independent ...
0
votes
0answers
28 views

plot lmer confidence intervals

I have a mixed model fitted with lmer4 [ModelSub = CA ~ P + T + S + (1|Study)] which yields the following estimates - ...
1
vote
1answer
24 views

Random variable in mixed-effect model (ecological studie)

I'm beginner with the mixed-effects model, so I already apologize if my question is a bit naive. My problem is the following : I sample each time 30 plants in 6 populations on 9 mountains. So I ...
1
vote
1answer
62 views

Addressing “NOTE: Results may be misleading due to involvement in interactions” warning with Tukey post-hoc comparisons in lsmeans R package

Background: I am using linear mixed-effects models (LMMs) in order to determine how the interaction between two fixed effects influences measures of a response variable. Since I am working with a ...
0
votes
0answers
36 views

scale() function and standardized values for fixed effects

I'm currently using the scale() function in a glmer model (see below) and I'm having some inconsistencies between my ...
1
vote
0answers
74 views

Testing and correctly interpreting the significance of nested random effects

I'm building a series of relatively simple random effects models where we repeatedly measure a water quality variable, say conductivity (cond), in different watersheds (ws) and streams (st). Here, ...
1
vote
0answers
37 views

What is a case where including random correlation parameters decreases the error on the fixed effects?

I'm wondering about the effect of true correlations among random effects on the standard error of my fixed effects in lme4::lmer models in R. My assumption is ...
2
votes
1answer
458 views

Obtaining adjusted (predicted) proportions with lme4 - using the glmer-function

I aim to estimate the annual proportion of patients (% of patients) that are smokers in a population whose age and sex must be taken into account. In other words, I want to calculate the adjusted ...
2
votes
1answer
44 views

Why are the beta values provided in lmer() different than simple group means of observations?

In a 2-level mixed-effect model, the equation for level-1 is $$Y_{ij} = \beta_{0j} + r_{ij}$$ where $\beta_{0j}$ is the mean outcome for the $j$-th group. I ran the following model: ...
1
vote
0answers
43 views

lme4 (v1.7) fails at fitting an “animal model” (LMM) compare to rrBLUP

I would like to fit a basic "animal model" (a kind of linear mixed model, see below) using the latest version of lme4 on CRAN (v1.7). To check the results, I am fitting it on simulated data, and ...
0
votes
1answer
81 views

Mixed effects model rank deficiency

I'm looking at the impact of dietary treatment and sex on weight. My dataset comprises weight data for 3 dietary treatments and sex (male and female). The experimental design was run in duplicate, do ...
1
vote
0answers
36 views

How to specify random effects in lmer

I have 3 groups of animals that are divided into 3 subgroups, each subgroup contains animals that are specific to each subgroup (there is no same animal in two groups). How do I specify random effects ...
0
votes
0answers
16 views

choosing the best structure of the random effects in a GLMM [duplicate]

I am trying to choose the best random effect structure in a GLMM, before starting with the fixed terms. To do that I include all the fixed effect and their interactions (beyond optimal model) and ...
2
votes
1answer
103 views

Mixed models and backward elimination

Let's say I have a data like this, and I'm trying to build a mixed model. ...
1
vote
0answers
35 views

lmer, effect of a ramdom factor in a covariate [closed]

hi I am doing a General Linear Mixed Model in R, lme4 package. I want to test the effect of a random effect on a covariate, as well as on the response variable. I thin that the command would be the ...
5
votes
1answer
80 views

Do I need more than one random slope?

When constructing a GLMM in R, do I need more than one random slope if I "see" that slopes differ for multiple continuous variables? In my case, I am analysing the number of plant species (...
10
votes
2answers
354 views

Random- and fixed-effects structure in linear-mixed models

Consider the following data from a two-way within subjects design: ...
2
votes
1answer
143 views

lmer and random effects

Here is somewhat simplified structure of the data I have, since fixed effects are quite straight forward, however, random effects are giving me a headache (like I said something new :) ): ...
1
vote
0answers
27 views

lmer nested design estimating variance of one level as zero

I have data from a series of psychology experiments in which human subjects completed one of many tasks. Multiple observations are taken per subject. Finally, tasks can be divided into one of two ...
2
votes
1answer
84 views

2 factor factorial model with random factors

Using lme4, how does one define a full 2-factor factorial model with both factors (and their interaction) being random? Specifically I am trying to recreate the ...
0
votes
1answer
70 views

Modeling error structure in lmer in R?

Is it possible to add a parameter to lmer model which will be modeling the error structure? Sth similar to TOEP(X) and SP(POW) from SAS???
2
votes
0answers
62 views

Mixed-effects: length of the experiment as a continuous fixed effect?

I have measurement of nitrogen uptake Nup across 4 different SITE very far from each other and in different years (e.g. ...
1
vote
0answers
26 views

Retrospective power analyis of lmer for sample size

I'm an MSc student doing an assignment where I am asked to analyze and write up a report on a dataset on environmental enrichment in zebra finches. Among other things we are being asked to do a ...
0
votes
0answers
74 views

In R package lme4, how do you force the random slopes and intercepts to be uncorrelated for an interaction term?

I have a mixed model, fit using lmer in R, that has three interaction terms (X1:X1, X1:X3, ...
1
vote
0answers
40 views

R lmer Model Diagnosis qqnorm

I fitted this lmer model: m1 <- lmer(logR ~ N_g.m.2 * Year + (1|Wh/N_g.m.2), data = CO2_Ratio) Rendering the attached qqplot. ...
2
votes
1answer
67 views

How do I contrast code for a factor where one level is the application of both of two others?

I have a factor 'Music' that has four levels: none, piano, guitar, and mixed. Subjects gave a response hearing no music, piano only, guitar only, or piano and guitar, so I want to create an lmer model ...
2
votes
0answers
26 views

Linear mixed model construction validation

I have 6 groups of fish made up of 8 individuals. Each group is tested three times under different treatments. These group level treatments are hungry , ...
0
votes
1answer
90 views

graphical representation of fixed effects from lmer

I have run a lmer model in R: ...
4
votes
1answer
209 views

How to formulate linear mixed model to find out effects of continuous variables?

I have a dataset with growth rate as a response variable (resp in the example) and temperature, food availability, and salinity as predictor variables (...