# Questions tagged [contrasts]

In linear models and particularly in ANOVA, a contrast is a linear combination of parameters with coefficients summing up to zero. It is used to test the corresponding null hypothesis. Contrasts are especially often used with categorical predictors (factors) to make comparisons among the groups (categories). [See also tag 'categorical-encoding']

373 questions
Filter by
Sorted by
Tagged with
2 votes
2 answers
36 views

### Test for interaction effect when contrasting specific timepoints in mixed-model

I'm having a mixed model (lmer in R) with 5 repeated measurements (time is categorical), and 6 groups, and several covariates. I'm mainly interested in seeing whether there is a significant difference ...
• 25
1 vote
1 answer
13 views

### What is the scaling applied to Helmert contrasts in emmeans?

I'm trying to understand why the values under 'estimate' from an emmeans contrast function differ from those of the default 'Estimate' values from, say, 'summary.lm()' in R. As an example, let's use ...
• 113
0 votes
0 answers
13 views

### Effect size calculation on a MANOVA with contrasts

I would like to conduct a repeated samples (patient) ANOVA (with Factor X with 3 levels A, B, C) with the planned contrasts (A+B)-C (i.e 1 1 -2) and (A+C)-B (i.e 1 -2 1) as well as calculate the ...
• 13
1 vote
1 answer
23 views

### How are simple effects calculated in JASP (and how to calculate them properly)?

I'm conducting 3-way (2x2x2) repeated measures ANOVA in JASP with a main factor of interest called symm, and two other factors: emotion (neutral/fearful) and masking (masked/unmasked). I want to ...
• 11
1 vote
0 answers
15 views

### Design matrix for getting desired contrasts in 3x3 design with 2 controls

We have nine conditions in our study (two category factors each with three levels; A: a1, a2, a3; S: s, c1, c2). I did two-way ANOVA; however, we are interested in a more nuanced question. c1 and c2 ...
• 11
0 votes
0 answers
7 views

### Type III ANOVA in a crossed interaction showing significant main effect

Given a crossed interaction: ...
0 votes
0 answers
37 views

### How to interpred effect and weighted effect coded regression with continuous and factor variable interaction

I have a linear mixed model y~(x)*fac+random fac has two levels, with different numbers of observations x is not normalized or centered but log transformed. given ...
• 83
0 votes
0 answers
12 views

### Linear mixed model poly contrast & numeric covariates

I want to compute mixed linear model and have a repeated measure design. I suspect dependent variable to decrease in an linear model with time. Which is why I defined the contrast for that variable as ...
0 votes
0 answers
75 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 &...
• 165
1 vote
1 answer
26 views

### Intercept of logistic regression with contrast coding

Say I have a binary dependent variable (Choice) being either 0 or 1, and people answer this DV multiple times. I also evenly split people in two groups (Group, group A vs group B). I simulate data so ...
• 33
0 votes
0 answers
32 views

### Pros and cons: Splitting a single dummy variable into multiple and fit seperately

I was discussing dummy coding with a colleague. They wanted to compute a series of combinations from the levels of a three-leveled categorical variable (A vs B+C; B vs A+C; C vs A+B) but as it's not ...
• 153
1 vote
1 answer
48 views

### Custom-define contrast - mix between dummy and Helmert coding

I'm trying to use custom-defined contrasts. They are sort of a combination of traditional dummy coding and the last contrast produced by reversed Helmert coding. In short, I want to compare each of ...
• 153
1 vote
1 answer
113 views

### How report planned contrast test results

I was reading through Andy Field's Discovering Statistics with SPSS. Following ANOVA, he ran several planned contrasts. When he described how to report the planned contrast results, he wrote this: “...
• 21
0 votes
0 answers
17 views

• 556
2 votes
2 answers
139 views

### Contrast coding and scaled estimates using emmeans / lmer

I am trying to analyse subgroups of a mixed-effects model using custom contrasts. I have 2 factors F1 and F2, each with 3 levels. My interest is in comparing the groups like this: F1_group1 vs. ...
• 41
0 votes
1 answer
82 views

### Must interacting dichotomous categorical predictors be treated as factors?

If examining the main effects of dichotomous categorical variables, the levels of which are binary and absolute (present/absent), must they be treated as factors rather than numerics? Would the answer ...
• 65
4 votes
2 answers
587 views

### Questions concerning visualizing model results with the R-package visreg

Following some discussions with colleagues, I'm seeking for clarification on how to visualize an ANCOVA with visreg, and what the visualization actually shows. I would like to run the following ANCOVA ...
• 71
1 vote
1 answer
228 views

### calculating selected contrasts with emmeans within treatment

I have a dataset that has data collected at 8 different timepoints and in 5 different treatment groups, and want to do multiple pairwise comparisons. However, I want to run comparisons only between ...
• 11
1 vote
0 answers
34 views

### How do we calculate Standard Errors for effect-coded variables?

I'm a beginner following this UCLA tutorial to figure out how to interpret coefficients for effect-coded categorical predictors and have a couple of questions regarding their regression table below, ...
• 11
3 votes
2 answers
173 views

### Is it preferable to subset data to test specific hypotheses or specify a full model and run contrasts?

Let's say I have a 2x2 design where participants are either in condition A or condition B and, within each condition, either get exposed to exposure C or exposure D. First, I want to test whether ...
• 760
1 vote
1 answer
255 views

### Categorical variable more than two levels

Say for the sake of argument I have a categorical variable called race. The variable has white, black, and Asian levels. I make two dummies (dummy variables) White and Asian (for variable white if 1 ...
• 881
0 votes
1 answer
43 views

### Is it appropriate to only specify the contrasts you are interested in?

I am running some contrasts in R using emmeans, and when I specify my contrasts like this: ...