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
0
votes
0answers
8 views

Handling cumulative exposure variables in mixed-effects logistic regression (MELR) models

I am working on analyzing the results of an observational study, a brief description of which is as follows: X number of diabetic subjects have been recruited to collect naturalistic driving data, ...
0
votes
0answers
12 views

Does a clustered bootstrap procedure have assumption about independence of errors?

I am performing a mixed model analysis including a lagged outcome variable (cross-lagged panel analysis in R using package lme4) which violates the assumption of independent errors (since they are ...
0
votes
1answer
29 views

lmer for simple unpooled statistics

I have one vector of predictor, one vector of response, and two columns of categories, each has two possible classifications. I tried to create an unpooled linear model using lmer, but I get ...
2
votes
1answer
34 views

Multilevel Modelling , 2 level -statistical significance test on random effects

I have fitted two-level MLM for synthetic data. I have fitted the model using lme4 package and also imported lmerTest for the statistical significance test of fixed effects. But I am unable to do ...
0
votes
1answer
42 views

How does R understand a multi level model?

I'm new to MLM both in R and in general. I have a dataset of Building permits for a couple of cities and I have created a variable counting the number of parcels with a permit. Now, I want to perform ...
1
vote
1answer
24 views

Cross-classified mixed models in lme4: How to code cluster variables when there are >2 random intercepts?

Let's suppose that I have a dataset where individual responses to a questionnaire are cross-classified within two grouping variables, G1 and G2. Based on this very informative post, it seems that ...
1
vote
1answer
31 views

Model for longitunal data with different interactions

I've now spent quite a bit of time doing research on linear mixed models in R using lme4 and lmer. However, I still read conflicting advice on how to best fit the model. This is my data: Longitudinal ...
3
votes
2answers
47 views

How to solve the error of singular fit in glmm in R

I am trying to fit a GLMM for binary data of whether colonies of bees perform mass flight or not. I have time when the mass flight was performed, temperature, location of the hive and species of the ...
0
votes
1answer
25 views

low marginal and high conditional R2 for mixed models

I have a suspicious output in my linear mixed model lmer() (lmer package), where I have marginal r2 of 0.08 and conditional of 0.8. I am not surprised by the low marginal r2, however, I am puzzled ...
0
votes
1answer
37 views

Is there a way to ask for “what changed between experiments”?

I have performed an experiment in which participants perform a task multiple times, the outcome being a binary "has succeeded or not". Two cohorts have performed the same experiment in two conditions ...
1
vote
0answers
24 views

Crossed and Nested Random Effects

I'm trying to use a multilevel model for the first time. I have an experiment using 4 different treatments/conditions (between-subject design) where participants are nested within each condition. ...
0
votes
1answer
24 views

Factors affecting SE and power in lmer: how do I have lower SD&CV but higher SE and lower power?

I using simulated data sets to compare the ability to two different experimental designs (A and B) to detect a interaction between two variables (x and y) in determining the observed output (o). The ...
1
vote
0answers
19 views

generating Heteroskedasticity- & autocorrelation-consistent (HAC) standard errors for mixed effects (LMER) models [closed]

Is there a package/code for generating robust Heteroskedasticity- and autocorrelation-consistent (HAC) standard errors for mixed-effects models (specifically lmer models) in R? I am aware of vcovHA, ...
0
votes
1answer
53 views

lme4 mixed model output coefficients seem incorrect

I have some data for carbon assimilation vs tree size for a range of tree species. I'm running a mixed model analysis using lme4 in R, with the random effect being ...
0
votes
0answers
24 views

Main effect significance disappeared after adjustment, but interaction still the same?

Hi I am confused by a result from my analysis. Could someone tell me is the situation possible? How can I interpret it? I have two linear mixed models, the data was from a family-based study. The ...
3
votes
1answer
112 views

Should repeated measures be included as a nested or a crossed random effect in glmer?

I have a field experiment looking at the effect of a seed-mix treatment on moth abundance and I am struggling to define the correct random effects structure. My experiment is structured like this: I ...
1
vote
1answer
30 views

R: Need some help on generalized linear mixed models with binomial data

I would like to find out how the probability of tree-microhabitat occurrence is related to the age of a tree and how is this relationship influenced by KKT and Tree species. Here is an example of my ...
3
votes
0answers
84 views

random slope in linear mixed model for longitudinal data in R

I am currently doing analysis on a longitudinal data set in which participants were followed druing several years at 3 time points at best. Some data are missing because of multiple reasons. So, I don’...
0
votes
0answers
40 views

Panel data, Mixed effect package lme4: random intercept, slope error

I got stuck in specifying random intercept and random slope model. The code was: ...
1
vote
2answers
28 views

Is it valid to use a difference score between sequential timepoints as an independent variable in a longitudinal regression analysis?

Is it valid to use change scores, i.e. like change in body weight taken between consecutive time points in longitudinal analysis where I'm using nlme/gee? For example, bodyweight at hour 3 minus ...
0
votes
2answers
36 views

Extract confidence intervals confint() for random estimates of lmer models

I want to test the significance of the random slope in my model, i.e. if there is significant individual difference in change. I am using lmer() and confint() in R The model is: ...
0
votes
1answer
43 views

GLM - Interpret residuals vs fitted plot

I realised a within-subject experiment and each participants went through three conditions and in each condition they performed a series of tasks of their choice (number of tasks is different for each ...
0
votes
0answers
28 views

Significance of mixed-effects model?

I currently have some mixed-effects models and I am unsure which one to use, and how to determine significance of them. Possibly a small issue I am having as i am confused which model gives me results ...
7
votes
1answer
149 views

( 3 level ) random intercept at level 2 & random slope and random intercept at level 3

I am trying to fit a three-level model with lme4, I got familiar with the notation about equation. But I am not able to express the random effects properly in level two and three, I have: on level ...
1
vote
0answers
25 views

Designing multilevel regression model using “lme4”? [duplicate]

Variation in crater rim thermal inertia has been observed, this variation is due to crater degradation or mantled rim. To check what is the possible cause for this variation in thermal inertia, I have ...
0
votes
0answers
15 views

Multilevel regression model using “lme4” R package?

Variation in crater rim thermal inertia has been observed, this variation is due to crater degradation or mantled rim. To check what is the possible cause for this variation in thermal inertia, I have ...
2
votes
1answer
50 views

Non-nested, multiple random intercepts to capture unique time effects in a longitudinal study

I am interested in using longitudinal (panel) data on children's academic achievement to understand how achievement varies as a function of how long a child has been in school. Imagine that I have ...
0
votes
1answer
21 views

Should group mean centring impact results of a multilevel mediation?

I'm currently writing up results from a multilevel model of my study and have come across an issue and was hoping for your help. Essentially, when running my mediation model using lmer and mediation ...
0
votes
1answer
56 views

Confusing results from lsmeans and pairwise tests

Experiment: I collected data from N participants, each was shown 50 photos and asked to provide sharing likelihood (dependent ...
4
votes
1answer
38 views

Proper syntax for coding group level variables in mixed effect model using GLMER

I am running a multilevel log odds regression on a dataset that is at the individual level. Each individual belongs to a district, and there are both individual level variables (which vary by ...
4
votes
1answer
41 views

lme4 - correct formula for a crossed factor nested mixed model

I am having a little trouble verifying correct notation for a crossed factor nested mixed model anova using lme4 package in R. My data is experimental, I applied two crossed treatments (light and ...
2
votes
1answer
28 views

random slope to vary across different grouping variables in mixed model

I have a mixed model of the form ...
4
votes
1answer
111 views

Specifying model in glmer() - interaction terms

I am running a generalised mixed effects model, of family logistic regression, using function glmer(). I am predicting likelihood of response (0/1) and my fixed effects to explore in my final model ...
1
vote
0answers
27 views

nested regression model using lmer?

I have to look for the affect of crater degradation, rim irregularity (RI), radii variation (RV), depth-diameter rati (Dd) and mantled rim percentage (MRP) on crater rim thermal inertia. 138 craters (...
0
votes
0answers
19 views

differences in fit

...
0
votes
0answers
23 views

Multilevel regression model using lme4 R package?

I have to test for the correlation between Thermal inertia (TI) and Depth-diameter ratio (Dd), Rim irregularity (RI), Radii variation (RV) and Mantled rim percentage (MRP). Total individual (ID) - 138,...
3
votes
1answer
56 views

Multi-level model [lme4 package] specification with cross-level predictors and group-level outcome in panel data

How do I specify a model based on panel data using the lmer package in a case where (a) my dependent variable is on the group level and the predictors vary across the group and individual level (b) my ...
6
votes
1answer
281 views

How to show that a random factor is not needed in the model?

I collected data from an experiment where I showed one of four videos (condition) to a person and asked them to predict how it ended / assign one of three labels to ...
0
votes
1answer
54 views

How to interpret mixed models?

I am a bit confused about how to interpret mixed-effects models. Here is an example of something that I currently have. When I show the visreg graph, it is only showing test/status as variables ...
0
votes
1answer
27 views

lme4: what is gained by scaling variables?

I am performing a multilevel logistic regression with glmer from the lme4-package. Currently, it's a very simple model of the ...
6
votes
2answers
117 views

Multilevel regression model using “multilevel” and “lme4” R packages?

After all data were collected, statistical analyses were performed to test for correlations between TI and D_d, RI, RV, and MRP. Due to the high amount of uncertainty introduced when comparing TI ...
1
vote
0answers
15 views

Attention Network Task using lme4 - optimal random effects structure?

I'm analysing reaction time data obtained using the attention network task (ANT). All participants were presented with three types of stimuli per trial - first, a warning tone (2 levels), then a cue (...
0
votes
0answers
16 views

Standardized beta coefficients from multi-level mixed model (package::nlme) - lme() in R

I have ran a 4-level-mixed model using nlme applying a continuous autoregressive covariance structure. I want to compile the standardized beta coefficients for my fixed effects. I have tried ...
3
votes
2answers
43 views

How can i use a mixed model for my situation?

I currently have some data but am unsure how I can model it using a mixed model. My data/variables are as follows: Test(factor) - A collection of 5 tests that every person has taken. As in, each ...
1
vote
1answer
36 views

Help with setup of a hierarchical linear model (lmer) in R, selection of fixed and random effects

I have calculated a particular parameter y in each subject our of 3 studies (each 15-30 subjects). In study #3, the subjects have been measured twice (with 2 different treatments, M and P), and ...
2
votes
1answer
198 views

Parameter recovery (Gamma distribution and model with a random intercept)

TL:DR version - I am trying to simulate data from a gamma distribution and then fit a Generalized Linear Mixed Model (GLMM) to recover the parameters. The parameter recovery for the fixed effects is ...
1
vote
1answer
37 views

How to do a mixed model with 4 factors?

I am curious how I can perform a mixed model with 4 factors and 1 continuous variable. lmer(Scores ~ 1 + (1 | Test) + (1 | Sex) + (1 | Age) + (1 | Status), df) ...
2
votes
0answers
40 views

OLRE's vs. Beta Binomial Model for Overdispersed Mixed Effect logistic regression with proportion data?

this is a long post, as I wanted to be sure to provide all relevant information regarding my data, model, the methods that I have tried so far, and my diagnostic plots. If there are ways I should ...
0
votes
0answers
32 views

Correct interpretation of coefficient estimates from GLM on binary outcome data [duplicate]

I'm currently analysing an experiment where animals were presented with a stimulus under two different treatments (Po & Br) ...
1
vote
0answers
26 views

What to include in random structure? lmer

Should we still have trial number in the linear mixed effects model as a random effect even if the trial order is randomized not only for each participant but each session? I included participants as ...

1 2 3 4 5 43