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 ...
Benji's user avatar
  • 413
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 ...
user674431's user avatar
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 ...
Kuba's user avatar
  • 1
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 (...
Yun's user avatar
  • 13
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 ...
brizzen's user avatar
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: ...
SilvaC's user avatar
  • 542
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 ...
yeshe's user avatar
  • 11
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 ...
Malin's user avatar
  • 1
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-...
Guillaume Pech's user avatar
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 ...
Frank Leoné's user avatar
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 ...
SilvaC's user avatar
  • 542
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 ...
Jane's user avatar
  • 3
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 ...
Fabi's user avatar
  • 75
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: ...
john connor's user avatar
1 vote
1 answer
266 views

Correction for multiple comparisons using sum contrasts with linear regression

I am computing the following model using the lme4 package in R: ...
Pearson's user avatar
  • 111
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 ...
Swarley's user avatar
  • 21
1 vote
1 answer
313 views

Calculate contrasts from lme model across specified timepoints

I have an MMRM with the below structure: ...
wingsoficarus116's user avatar
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 ...
Michael Roswell's user avatar
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 &...
HNSKD's user avatar
  • 227
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 (...
BioLeal's user avatar
  • 175
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 ...
Florent Wyckmans's user avatar
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 ...
Elizabeth's user avatar
  • 135
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 ...
FalleS's user avatar
  • 21
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 ...
user46212's user avatar
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, ...
john connor's user avatar
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 ...
a.henrietty's user avatar
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: ...
Fabio 's user avatar
  • 13
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". ...
Hans Jürgen's user avatar
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-...
CatM's user avatar
  • 526
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) ...
Potato's user avatar
  • 73
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: ...
user261885's user avatar
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 ...
CogNeuro123's user avatar
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 ...
AMS's user avatar
  • 31
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 ...
Cristiano's user avatar
  • 539
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 ...
Galit's user avatar
  • 197
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 ...
witek's user avatar
  • 334
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 ...
Tom's user avatar
  • 11
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), ...
Lollo's user avatar
  • 53
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 ...
matt's user avatar
  • 21
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: ...
R. Bench's user avatar
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 ...
nico's user avatar
  • 4,591
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-...
llewmills's user avatar
  • 2,187
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" ...
Kirk Geier's user avatar
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 ...
user8460166's user avatar
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: <...
NoaHo's user avatar
  • 21
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: ...
J.Broken-Brow's user avatar
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 ...
HernanLG's user avatar
  • 211
1 vote
1 answer
2k views

Within-subjects contrasts in repeated measures anova with unbalanced design [closed]

I would like to reproduce the standard output of a repeated measures anova in SPSS with R. For a balanced design (i.e. equal group sizes) I can exactly reproduce the SPSS output of the within-subjects ...
Steve's user avatar
  • 33
2 votes
0 answers
332 views

Contrasts are giving wrong estimates using glht in R

The problem: glht is giving the direct differences between the estimates of the summary table (i.e., not summing each estimate with the intercept to obtain the estimated value). ...
tmalves's user avatar
  • 78
1 vote
0 answers
272 views

How to design a contrast matrix with a continuous variable

I was wondering if someone could help me designing a contrast matrix when you have a continuous variable. My model looks like this: ...
Carlos's user avatar
  • 11