Questions tagged [lme4-nlme]

lme4 and nlme are R packages used for fitting linear, generalized linear and nonlinear mixed effects models. For general questions about mixed models use [mixed-model] tag.

Filter by
Sorted by
Tagged with
3 votes
1 answer
37 views

Why does nlme::fdHess return NaNs when evaluated at 0? [closed]

Why does the finite-differences gradient/hessian approximation nlme::fdHess return NaNs when seeking the gradient/hessian at 0? <...
kara890's user avatar
  • 129
1 vote
1 answer
32 views

How to specify a linear mixed model (LMM) for a repeated measures design with two categorical predictors and one continuous?

I would appreciate some help figuring whether a linear mixed model (LMM) is a good choice for my data. My experiment is a 3 (neurostimulation target) X 2 (task block) repeated measures design that ...
arhopki's user avatar
  • 11
0 votes
0 answers
28 views

Linear mixed-effects models or one-hot encoding for grouped data

I wish to perform linear regression over a data set whose entries can be divided into two or more groups. The groups could be, for example, the date at which observations where taken, or the patient ...
altroware's user avatar
  • 156
0 votes
0 answers
37 views

Mixed effects model for prediction

I have a dataset where I collected cortisol samples 3 times a day, for 3 days at 2 timepoints. I am interested in looking at changes in cortisol right after awakening, at 0 min after awakening, 30 min ...
magg's user avatar
  • 13
0 votes
0 answers
21 views

gamm4 output size is too large (~5GB). How to decrease? [closed]

I am running a Generalized Additive Mixed Model with the R package, gamm4. Each model output includes a mer object and a gam object. I need to compare 26 model structures based on a combination of ...
megsruppUNBC's user avatar
0 votes
0 answers
14 views

Mixed Models two continuous time-points

I'm using a mixed model to do a hypothesis test of an intervention effect (group: 0=control, 1=intervention) in an RCT with two time-points: Baseline plus follow-up 6 months after baseline. In ...
Sebastian's user avatar
1 vote
2 answers
37 views

Is it bad to have large random effect variance when fixed effect estimates are small?

I'm running a generalized linear mixed models (GLMM) and am comparing the Laplace approximation to the Gauss-Hermite Quadrature. I have three predictor variables (fixed effects) and each is a number ...
burphound's user avatar
2 votes
1 answer
40 views

How does lme4 handle participants who only have data for only one level of a categorial variable

I'm using the lme4 package to assess the impact of a variable 'A,' which consists of three levels (1, 2, and 3), on the responses of 15 participants. My model is structured as follows: ...
user396637's user avatar
2 votes
2 answers
79 views

Why is lmer model correlation in R very different when switching the predictor and response variable?

I am using the lme4 package to create a linear mixed effects model that accounts for repeated measures. Data ...
Eric Dilley's user avatar
0 votes
0 answers
19 views

Get random effect value from pattern of data

Rasch models are typically fit through an item response theory framework, but can also be estimated through a mixed effects model (e.g., see here). This is highly useful in my case because of some of ...
Daniel Anderson's user avatar
0 votes
1 answer
22 views

Likelihood ratio tests vs. ANOVA for interactions in linear mixed model

I am analyzing a longitudinal study where patients received either treatment 1, treatment 2 or no treatment (placebo) using linear mixed models (LMM) in R. I have a baseline measure that is related to ...
BulkySplash's user avatar
1 vote
0 answers
13 views

Am I specifying a 3 level model correctly with lme4?

I am new to lme4 and curious if I am specifying my model correctly. I have EMA data that was collected within 3 bursts (baseline, mid-intervention and post-intervention). Within each burst, ...
Stats_curious's user avatar
0 votes
0 answers
7 views

Can I compare if the outputs of different Generalized least-squares models are distinct in a statistically significant manner?

So I want to compare whether using human scoring or using modelling of avian vision for scoring significantly affects the correlation between rummage brightness and altitude. To do this, I am running ...
Birdman's user avatar
1 vote
0 answers
25 views

Lmer R: linear mixed model with random intercepts and nested variables

I want to write a model for my data on cell counts in specific brain regions. The multilevel structure of the data is as follows: Measurements within subregions with axes within animal Subregion and ...
user avatar
2 votes
1 answer
30 views

Nested data correction with mixed models

We have collected data from n patients, with each patient having one eye treated and the other untreated. We would like to see if the treated eye progresses differently to the untreated eye using ...
JP1's user avatar
  • 191
0 votes
0 answers
20 views

Are the p-values of the anova on an lme4 object one- or two-sided?

If I run the following r code: m_train = lmer(y ~ x * z + (1|x), data=data) anova(m_train) Are the resulting F statistics one-sided or two-sided? Thank you very ...
ebeanato's user avatar
0 votes
0 answers
23 views

Split plot design - help with choosing the analysis

I have a split-plot design experiment with three levels (slope, then treatment within slope, then cages within each treatment), with the main response being a count of seedlings. South South ...
Maia's user avatar
  • 1
0 votes
0 answers
8 views

Which method is used to estimate the power in the outpout of the VarPower() structure in R

I am applying the power of covariate (varPower() in R) variance structure to the data, but I cannot find which method is used to estimate the power in this structure. If anyone knows, it would be very ...
Margarita M's user avatar
0 votes
2 answers
71 views

lmer() for the case when the independent variable ( covariate ) has only one measurement and the dependent variable has multiple measurement

How can a linear mixed-effects modeling approach using the lmer() function be applied to investigate the relationship between a single-measured independent variable ...
Omar Rafique's user avatar
0 votes
0 answers
34 views

R: emtrends pairwise contrast results change when testing slopes against 0 or 1

When performing post-hoc simple slope analysis on my linear mixed effect model in R using emtrends(), I noticed that pairwise slope comparisons showed differences in the significance when I tested all ...
Malin's user avatar
  • 1
1 vote
1 answer
97 views

mixed model specification in R (interactions and nesting)

I'm working with data from an experiment that I plan to analyze using a mixed-effects logistic model. In this study, 200 participants (identified by the variable Participant) were randomly assigned to ...
RNewbie's user avatar
  • 11
4 votes
1 answer
81 views

Predict person parameters in explanatory IRT with lme4

I am using glmer from lm4 in R to run an explanatory IRT analysis. The aim is to model person parameters with items nested in persons and to control for age (the test scale has 10 items; all persons ...
Wolfgang Lenhard's user avatar
0 votes
0 answers
18 views

Poisson regression with random effect using pre-post data

I have data on outcomes collected across several clinics. The outcome is an integer indicating days until treatment initiation. Outcome data were collected at baseline and follow up, and are collected ...
jpsmith's user avatar
  • 307
0 votes
0 answers
26 views

Standardizing level-1 predictors in multilevel models

There has been discussion about this topic (e.g. here, here and this recent question with no answers yet prompted me to ask this as I haven't found a clear answer to this question). So, when fitting ...
Sointu's user avatar
  • 979
0 votes
0 answers
30 views

For mixed effects model with multiple random intercepts, are bayesian approaches (with MCMC) more robust than frequentist?

I stumbled upon this particular webpage from UCLA containing the following text: [...] Inference from GLMMs is complicated. Except for cases where there are many observations at each level (...
user395154's user avatar
0 votes
1 answer
17 views

How to account for repeated measures of samples through time in using mixed effect models

I have an experiment where I repeatedly took sediment samples from inside and outside of the same plots in spring and summer for 3 years. For example, sample_IA represents a sample from inside plot A ...
user avatar
0 votes
0 answers
24 views

What is interpretation of `V1 ~ V2 + (V3|V4)` in a mixed effects model?

My question is directly linked to the popular lmer cheat sheet. There was one situation that I didn't see mentioned in that cheat sheet and I wanted to know if it was a valid scenario or something ...
D.C. the III's user avatar
0 votes
0 answers
22 views

Running all possible fixed effects combinations, LMER, PCA [duplicate]

my data looks like that: ...
Chemokine1's user avatar
0 votes
0 answers
23 views

Running all possible fixed effects combinations for linear mixed effects models

my data looks like this: ...
Chemokine1's user avatar
2 votes
0 answers
43 views

The correct implementation of random effects

I apologize because frankly no matter how many stack exchange posts I read, I read the lmer cheat sheet, online guides, and even helpful articles yet random effects just do not make much sense. My ...
Eric Chantland's user avatar
0 votes
0 answers
13 views

glmer in lme4, interpreting significant sum-coded interaction in the presence of non-significant pairwise comparisons

This is my first question, so I apologize if I am leaving out information. If that's the case, I'll do my best to fix it. I have two predictors of interest, sentence type (PO, DO) and condition (given-...
EerieBud's user avatar
0 votes
0 answers
12 views

Convert mixed linear model from lmer to lme to create model with equal variances for fixed effect

I am currently working with mixed linear models, with which I want to compare whether variance between two methods is statistically different. This is my model code (using lmer package): ...
Querijn's user avatar
0 votes
0 answers
8 views

Can I include interaction effects in a multilevel random intercept, but fixed slope model?

I am using the lmer-command within the lme4-package to analyse a fixed intercept, random slope model: ...
Dorothea Glaesser's user avatar
0 votes
1 answer
67 views

Correct specification of cross-level interaction using lme4

For a paper on social norms, I want to predict an individual attitude by an interaction of another individual attitude with attitudes that people within the same region (e.g., cluster) hold. In the ...
Leon Walter's user avatar
0 votes
0 answers
16 views

Within-subject mean centering of covariate in linear mixed models

I have a within-subject repeated measures dataset where participants were asked to rate images (48 items) at 3 separate time points (t0,t1,t2). Their ratings at t0 is what is defined as baseline, as ...
sinandrei's user avatar
2 votes
0 answers
24 views

Faster version of lme4 for logistic regression 3-level multilevel model in R with 2 million data points

I'm running a 3-level multilevel model in R with binary outcomes and survival analysis with over 2 million data points. The lme4 package takes 12 hours to run one ...
user19890826's user avatar
0 votes
1 answer
32 views

Why are the AD, ACME and Prop. Mediated identical for control and treated groups in mediation analysis?

I have conducted a basic mediation analysis using mediation::mediate. My treatment variable (X) is a binary variable with two groups. My mediator and outcome variables are continuous. I also have a ...
Jade's user avatar
  • 63
0 votes
0 answers
37 views

How are the number of levels calculated in a nested random effect within Linear Mixed Model

I am testing various linear mixed models (in R using lmer())and am concerned about the lack of levels in one of my parameters, and how it influences the results. ...
MrSwaggins's user avatar
0 votes
0 answers
24 views

interaction terms to assess effect of a series of variable on the relationship between an independent variable and outcome variable

Let's say that I have an independent variable x1 which I'd like to explore its association with Y (a binary outcome variable). Furthermore I'd like to explore how x1 associated with Y when x2 ...
user394487's user avatar
1 vote
1 answer
83 views

Reporting results from a GLMER

I have conducted a generalized linear mixed model (GLMM). For the output, see below. Normally (when reporting results from an ANOVA), I write something like this: $F(1, 116) = 6.09$, $p = .015$, $η2 = ...
Sebastian Böckenhauer's user avatar
1 vote
0 answers
21 views

'Response is Constant' error in R - GLMER

I have some categorical data which is coded 0/1 at the observation (in this case, interest area) level. I have averaged these values per trial, which provides me with a probability value between 0 and ...
S2068's user avatar
  • 13
0 votes
1 answer
12 views

Family/Link for averaged categorical data

I have categorical data coded 0/1 at the observation level. I have averaged these values across trials, obtaining a probability value between 0 and 1. I am running GLME's in R using ...
S2068's user avatar
  • 13
0 votes
1 answer
32 views

Interpretation of 3-way interaction in a linear mixed model

I evaluated the effectiveness of an intervention by using lme4 package with the variables ...
Sandi's user avatar
  • 1
0 votes
1 answer
32 views

Why do you always need to interact the covariates with the slope in mutlilevel models?

On a number of occassions, I have seen people remark that you should always interact your covariates with the with your slope when running multilevel models. That is, for example, you should not run ...
statslearner13's user avatar
0 votes
0 answers
30 views

When, why and how to use random slopes with three-way cross-level interactions in multilevel models? [duplicate]

I am trying to estimate a hierarchical (random/fixed/mixed?) model with cross-level interactions and I can't wrap my head around if, how and where and why I should include random intercepts and slopes....
hlm_guest's user avatar
0 votes
0 answers
24 views

Why are reported std devs different from measured std devs for lmer random effects and residuals?

...
Chechy Levas's user avatar
  • 1,183
1 vote
0 answers
18 views

MICE for longitudinal data - shall I include both id and time variable for imputing outcome

The missing variable in my longitudinal data set is the outcome variable. I try to use mice in R to do multiple imputation. The final model is mixed effect model fitted by lmer. The data set contains ...
Charlotte's user avatar
1 vote
1 answer
36 views

Inverse and log function get opposite results in GLMM - which one to pick?

I am trying to fit GLMM in R where we predict reaction times (RTs, dependent variable) by a continuous, uniformly distributed variable called scores (independent variable); the random effect is the ...
user9361's user avatar
0 votes
1 answer
72 views

Proper lme4 equation with fixed and random effects for group differences

I have a dataset comprised of whole fish concentrations (LAB_RESULT.x), filet fish concentrations (LAB_RESULT.y), and species name (COMMON_NAME.x). I am attempting to run a linear mixed effects model ...
levane07's user avatar
0 votes
0 answers
28 views

Implementation of cross-classified multilevel mediation in R

I want to model the effect of the experimental factor x on the response variable y. However, we also want to test whether the effect of x on y is mediated by the mediator m. We aim to model this using ...
CapsLock's user avatar

1
2 3 4 5
67