Skip to main content

All Questions

Tagged with
Filter by
Sorted by
Tagged with
2 votes
1 answer
35 views

How can I compare one group to the mean of all other groups in a longitudinal mixed-effects regression?

I have a longitudinal mixed-effects regression comparing change in depression between two timepoints across 12 groups. I'd like to know if the control group is significantly less effective in reducing ...
0 votes
0 answers
44 views

glmer estimate is negative, but should be positive

I'm looking at a glmer for my masters thesis research (I cannot share the data until after thesis is completed so I will try to be very explicit in the descriptions). But to summarize, my dependent ...
0 votes
0 answers
12 views

Meaning of lognormal in performance::check_distribution() in R [duplicate]

I modeled my data using lme4:lmer() function. Since the model's performance was not satisfactory, I used function performance::check_distribution() which suggested that both predicted distribution of ...
1 vote
1 answer
313 views

Calculate contrasts from lme model across specified timepoints

I have an MMRM with the below structure: ...
1 vote
1 answer
79 views

How to set contrasts for contrast in post-hoc comparison of linear mixed effect model in R?

i am new in R and studying statistical analysis for experiments, please help me~ I have 3 age groups (Y/HO/LO) and 2 conditions (Related/Unrelated). I am running a linear regression model on RT (...
0 votes
0 answers
34 views

Apply custom (ANOVA-like) contrasts to all interactions in a mixed model (with a stacked dataset)

I am conducting a multilevel mediation analysis with a multicategorical X (4 levels from a 2-by-2 design) for which I want to apply custom contrasts that code two ...
1 vote
1 answer
30 views

Interpretation of Intercept in mixed model with repeated contrasts

I am running the following logistic mixed model in lme4: ...
1 vote
1 answer
357 views

Problems with emmeans if RE-adjustment and backtransformation from logit

In an experiment (4 sessions, 2 groups), subjects try to remember words. We want to test H1: the overall (marginal) main effect of group H2: the specific interaction contrast of group and sesson1 _ 2 ...
1 vote
0 answers
46 views

Custom contrasts in piecewise mixed effects models

I have longitudinal data from a two-group RCT in which the primary outcome was assessed at baseline, each week during the intervention, post-test and 5-month follow-up (6 times total). I am modeling ...
0 votes
1 answer
2k views

Contrasts in logistic regression using R

I am trying to use contrasts in a logistic regression using the lme4 package. I have two between-subject categorical variables (both with 2 levels). The first distinguishes between groups 1 and 2; the ...
0 votes
0 answers
299 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 ...
0 votes
1 answer
36 views

Access to the interaction of two three level factors on a mixed model

Using a mixed model (either frequentist lmer or bayesian brms) I have an issue regarding an interaction in my model. I have two factor variable of three level : condition (0-1-2) and Tps_real (0-300-...
2 votes
0 answers
74 views

R, lme4, glmer function: How to calculate significance values for Helmert contrasts? [closed]

I am running a GLMM using the glmer function from the lme4 package in R. I would like to use a Helmert contrast to test a specific difference for the factor condition. If I run that in the glmer ...
2 votes
1 answer
111 views

Interpretation of lme4 output with different contrasts for variables

I have data assessing reaction time (RT) with 2 variables: Variable 1: 'HighLow', with 2 levels ('High' and 'Low') Variable 2: 'Condition', with 3 levels ('Predicted', 'Implausible', 'Plaus/Unpred') I ...
0 votes
1 answer
165 views

Three-level variable in LME analysis - output

I am currently unsure about a three-level variable in an linear mixed effects analysis in R (lme4) - I should add that I am new to LMEs and would very much appreciate some very basic advice! I am ...
1 vote
1 answer
1k views

emmeans: interaction contrast with continuous variable - same se, t- and p-values?

I am analysing my own data with a linear mixed model and estimated marginal means and have made a strange observation. I have run an experimental study with three treatment groups, measuring a ...
2 votes
1 answer
734 views

How to obtain contrasts for constrained longitudinal data analysis?

I would like to apply a constrained longitudinal data analysis (cLDA) with a linear response variable of the form, y ~ Time + Treatment:Time + (1 | ID). I am using &...
0 votes
1 answer
337 views

How do you conduct contrasts (pairwise comparisons) for a lmer() when your IV is continuous?

I am using lmer() to run an analysis with one categorical variable with 2 levels (task) and one continuous variable (farFC). Below is the model: ...
1 vote
1 answer
267 views

Correction for multiple comparisons using sum contrasts with linear regression

I am computing the following model using the lme4 package in R: ...
1 vote
1 answer
875 views

planned contrast with **emmeans** on interaction term in mixed model

I think this is simple: I want to test if a treatment (that I know a priori does something) is stronger in one group vs. the other (in the presence of random effects). This seems like it should be ...
6 votes
1 answer
617 views

GLMM model specification help gender effects + an effect that is nested only within female

Main question: "What are the contributing variates to daily movement distances?" Specifically my question today relates to: "What is the contribution related to gender, and then within ...
1 vote
0 answers
37 views

Experiment with two within-subjects and one between-subject with linear mixed models?

I need to analyze one dataset that contain two variables measured in the same subject and one across subjects. The variables are: id = subject id, factor with 83 levels tissue = factor with 2 levels (...
11 votes
1 answer
22k views

How to set custom contrasts with lmer in R

I am using lmer in R to check the effect of condition (cond) on some result. Here are some made up data, where s is the subject identifier and ...
0 votes
0 answers
41 views

Contrasts in LMER, one IV

I am performing my first LME. In my data set, I have one fixed factor, “Consistency” (3 levels: con, inc, pro). Subject, Passage, and Stim_set are random effects (stim set just contains a particular ...
2 votes
1 answer
1k views

How ti specify contrasts for lmer model

I am using lmer in R to check the effect of treatment and a group on some result (y). In my data (dat), there are 3 categorical variables and a continuous response variable: 1 id 1 treatment variable ...
1 vote
0 answers
121 views

Predefined contrasts with lme4

in my current project I'm interested in setting certain contrasts ahead of analysis. I have five experimental groups, the control one (A), two groups with low dose (B and C) of chemical and two with ...
1 vote
0 answers
504 views

Contr.sums and contr.poly question?

I know that contr.poly creates orthogonal polynomials of degree 1, 2, etc. so that you can determine if there is a particularly mathematical pattern (e.g., linear, ...
1 vote
0 answers
23 views

LRT signficiant but not planned contrasts (mixed model)

I set up multiple models (each model adding a main effect and an interaction) with glmerfrom the R package lme4. Conducting a ...
1 vote
1 answer
346 views

Can contrasts and interaction contrasts be identical in linear mixed model?

I have a doubt with respect to the estimated marginal means of a linear mixed model. I performed a mixed model like the one in the example below: ...
0 votes
0 answers
536 views

Use predict function for average over all levels with contrast.sum

I have a model with Machine as factorial variable. The contrast is set to "contr.sum". ...
3 votes
1 answer
89 views

Is it ok to define the contrasts after building the model?

I have this mode starting model but I need to build the random structure but I am not sure if I can do that without setting the contrasts. Variable Time is a 3-...
1 vote
1 answer
373 views

Testing contrasts in multilevel models

I'm trying to think of a way to test certain hypotheses regarding an experiment I've run. It's a 2 x 3 x 4 within-subjects, repeated-measures design. I would like to fit a (cross-classified) ...
0 votes
1 answer
231 views

Mixed model contrasts for testing whether group differences increase/decrease across time points

I'm trying to fit a lmer model in order to predict whether group differences in scores on a scale increase/decrease over time. The dataset includes the following variables: Dependent variable: ...
1 vote
1 answer
377 views

How to report orthogonal contrast codes?

In my linear mixed effects model, I had a significant interaction, I followed up the interaction with orthogonal contrast codes to see where the difference was. How do I report my findings, other ...
2 votes
2 answers
612 views

Forcing nlme to give the results for the levels of a treatment as "absolute" values instead of contrasts

I am using a nonlinear model to fit an equation to data using nlme in R. Several values (one by treatment) are estimated for a fixed effect. As usual, by default ...
2 votes
0 answers
269 views

Planned Contrasts in Mixed models: group with 3 levels

This analysis is based on data from https://stats.idre.ucla.edu/r/seminars/repeated-measures-analysis-with-r/ with some modifications. Pulse measurements were made at 3 time points (1,2,3) for study ...
3 votes
1 answer
2k views

treatment and sum contrasts, inconsistent results

I am fitting a linear mixed effect models with two factors (mPair with 6 levels, and spd_des with 3 levels) and their ...
1 vote
1 answer
317 views

changing the coding system from helmert coding to difference coding changes regression results?

EDIT: I think I have mistaken the names of the coding systems, so I changed it (in bold). The content has not changed at all, though, so I would still appreciate any answer. END EDIT I'm running ...
2 votes
2 answers
383 views

How to model repeated measurements with mixed effect models - lme4

I have a dataset of temperature measurements within a day 6 am, 6 pm, for two groups of patients health and flue, There are repeated measurements on the same patient and same timepoint - measurements ...
1 vote
1 answer
326 views

Combining successive and treatment contrasts in lmer

I am running a lmer mixed effects model with three fixed effects parameters, each having multiple levels: predic1: HH LR RR LD (4 levels) predic3: L1 L2 L3 L4 (4 levels) predic2: A B C D E F (5 ...
2 votes
0 answers
651 views

How to perform post-hoc tests with the package emmeans [closed]

After running a generalised linear mixed effect model I have estimated the logit probability by using "emtrends" from emmeans package. The variable Condition is a factor with 3 levels(old,lure,new), ...
5 votes
3 answers
5k views

Specify contrasts for lme with interactions

I have used lme to generate a mixed effect model of the response of cells to a certain stimulus. The stimulus is applied 3 times in a row (coded by the Exposure ...
2 votes
0 answers
708 views

Setting contrasts in lme4: contr.treatment vs contr.sdif [closed]

In my study, each participant completed the very same Reaction Time task 3 times in 3 Sessions. I am not entirely sure if I should code the variable "Session" using ...
2 votes
0 answers
403 views

Linear mixed model: Setting custom contrasts for interactions and main effects with glht in R

I am currently learning statistics with R, and I am a bit confused about how to set custom contrasts for interaction effects. I tried removing the intercept from my model: ...
3 votes
1 answer
4k views

Results of Type-3 Wald Chi-Square Different for GLMM with Different Contrast Coding

I have just completed a multilevel, longitudinal logistic regression testing, at four different time points, whether participants in an experimental group are more likely to have committed any drug-...
1 vote
1 answer
1k views

LMER Factor vs numeric Interaction

I am attempting to use lmer to model my data. My data has 2 independent variables and a dependent variable. The first is "Morph" and has values "Identical", "Near", "Far". The second is "Response" ...
4 votes
1 answer
7k views

How to interpret sum contrast in regression (LMM)?

I am having difficulty understanding how the results from Linear Mixed Effects model. I am examining the three different types of learning condition, condition A, B, and C. My formula using Lme4 ...
2 votes
1 answer
734 views

Calculating ratios for contrasts after lmer model

I have performed lmer on my data and, to be generic, my model has 3 fixed effects (A,B,C) and 3 nested random effects (d,e,f) following the response variable y: <...
1 vote
1 answer
470 views

ANOVA contrast estimates in R

I'm doing a contrast anova on a dataset, and I'm just not sure what to do to get the lsmeans estimates relating to one particular contrast (c1). Here is my code: ...
0 votes
0 answers
201 views

Interpretation of a three-level contrast in a linear mixed-effect model in R

I have a linear mixed effect model in R where my fixed effect consists of three levels: Yes, No and ...