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']

Filter by
Sorted by
Tagged with
0
votes
0answers
4 views

Polynomial and simple contrasts for anova

Im wondering if anyone can help me. Im trying to do a 2x16 repeated measures ANOVA with two conditions across 16 timepoints. The main effect of time came out as significant and I was interested in ...
0
votes
1answer
26 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 ...
0
votes
0answers
14 views

Contrast coding for 2x3 interaction coefficients

I'm using a Bayesian Poisson ANOVA to estimate the strength of interaction between a 2-level and 3-level variable. I'd like to report a single contrast if possible, but I'm not sure how to design the ...
1
vote
0answers
15 views

Logic of forward or backward difference coding

Two systems of contrast coding for ordinal data are forward difference coding and backward difference coding. I will focus on the latter system here because it seems to be more commonly used, but my ...
0
votes
0answers
23 views

Can you conduct contrast analyses when interaction effect is non-significant?

I ran a 2 (factor A: A1 vs. A2) X 2 (factor B: B1 vs. B2) between-subjects design experiment. I had an a priori prediction that the effect of factor B (i.e. the difference between B1 vs. B2) would ...
0
votes
0answers
29 views

Effect size for contrasts tests in ezANOVA

My case: R user. I'm conducting 3-way ANOVA with 1 within and 2 between factors using "ez" library. N = 120, balanced-design. I would like to conduct contrasts tests with corresponding Cohen's D ...
0
votes
0answers
182 views

Should I be concerned about the warning message in model.matrix.default() - non-list contrasts argument ignored?

I am running a GAMM (mgcv package) with percentage/proportion as the dependent variable and a mixture of categorical and continuous variables, after running most of my models, this is the warning ...
0
votes
0answers
10 views

Can contrasts that test differences between predictor levels be negative?

I am trying to find a set on contrasts that identify differences between both the type and the time of the predictor. The predictor is set up as follows: A- Temp, 5 Sec B - Temp, 10 sec C- Temp, 15 ...
0
votes
1answer
21 views

Reporting results of a GLMM with Helmert contrast in fixed effects

I would like help deciding how to report my results. I am looking at whether different demonstrations affect performance in a forced-choice binary task. Demonstrations were done either by a puppet or ...
0
votes
0answers
25 views

Need of p-value adjustment when analyzing all possible pairs of factor levels in linear model

I have a nominal (not ordinal) variable with $K$ levels (these are actualy some groups of patients) and I run linear model in which: this nominal variable is one of IV's (others are age, sex and so ...
0
votes
0answers
48 views

How to interpret coefficients obtained from an ordinal variable in a linear regression?

I'm following this example https://stats.idre.ucla.edu/r/library/r-library-contrast-coding-systems-for-categorical-variables/ I was wondering what is the correct interpretation of the coefficients ...
0
votes
0answers
12 views

between group contrasts using effect coded dummy variables in regression

I was taught a technique for doing this but can no longer figure out why this works, though using a simple data set I am able to prove it. I will go through that proof here as I think it's the ...
0
votes
0answers
16 views

R - using contrasts to compare all levels of a variable?

I am doing a statistical analysis in R. I made a lmer() model, in which a variable has 4 levels (1,2,3,4). The script sets up a contrast matrix for these levels. Basically, The main hypothesis is set ...
0
votes
0answers
33 views

Fixed/Mixed effects models - emmeans, contrasts, etc

I'm taking a GLMM course and working through some homework that conceptually isn't that difficult, but is very challenging with respect to implementation in R. The dataset is composed of ...
0
votes
0answers
24 views

How to compare approximate Bayes Factors (BIC) with glm.nb? (R stats)

I have a situation where I would like to write up an analysis where the statistical significance is non-significant. I wanted to be able to accept the null hypothesis instead of merely 'failing to ...
2
votes
0answers
9 views

How to set up contrasts in a linear regression models that involve averaging over levels of another factor?

For simplicity, assume we have a linear model which looks like this: Outcome = beta0 + beta1*Treatment + beta2*Time + beta3*Treatment*Time + error where ...
2
votes
0answers
38 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 ...
0
votes
1answer
43 views

difference between interaction with anova and contrast functions

I'm trying to understand the difference between the interaction with the anova function and the interaction with the contrast ...
1
vote
0answers
37 views

Can planned contrasts in ANOVA be one tailed tests?

I have an experiment with 3 within-subject conditions: A, B and C. My dependent variable is reaction time. I am interested in comparing A to B and A to C. Using aov() on R I run an one way ANOVA with ...
0
votes
0answers
13 views

Scheffe's S Method - help with finding the absolute value of l

I am trying to understand Scheffe's S Method and how the absolute value of l is found. In the example I am reading, the absolute value of l is |-.836| but I have absolutely no idea how this value was ...
1
vote
1answer
147 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
0answers
133 views

R - Linear Regression with parameters constraint - contr.sum contrast

I am facing a problem with running a simple OLS regression with two categorical independent variable. I would like to impose that the sum of the coefficients referred to one variable (x in the ...
5
votes
1answer
308 views

When is deviation coding useful?

After many years of learning about contrasts in linear models I am curious about the relative usefulness of deviation coding, as it is defined by this website. I would appreciate someone filling me in ...
5
votes
1answer
131 views

How to calculate (standardized) orthogonal contrast coding in R?

I want to determine efficient fractional factorial designs and blocked designs for factorial surveys and am using the R library AlgDesign. The criteria I'm using to determine if a design is efficient ...
0
votes
1answer
268 views

Difference between Within-Subject Contrasts and Pairwise Comparisons in a Repeated Measures ANOVA

I'm running a two way repeated measures ANOVA, and I'm having trouble finding what is the appropriate output to report (Contrasts vs Pairwise Comparisons). I have a 2x5 design. Lets say I have ...
0
votes
0answers
18 views

Stratify phylogeny based on variables - e.g. which ST are represented by high % males

So I have tree file and metadata. Metadata includes sequence type ST (clusters that correspond in most part to the phylogeny), but also some patient data, age, sex etc. I am trying to identify which ...
1
vote
0answers
7 views

Can and should you avoid implicit pretesting for differences in group means?

Suppose I have a population with four (or more) disjoint sub-populations which differ from one another by traitishness, the union of which is the whole population. I have an outcome measure on the ...
2
votes
0answers
55 views

Simple effects in mixed design with R [closed]

My experiment consists of two factors, one between and one within subject. Time is the between-subjects factor and hold two levels: (low and high). Times is the within-subject factors and hold three ...
0
votes
1answer
119 views

Problem with Tuckey correction for planned contrasts with emmeans and pairs() in R

I tried to post my question in Stack Overflow but they suggest me to ask to the statistic expert (you), so here I am! I have a mixed design with 1 between factor (Group: ASD, CTR) and three within ...
0
votes
0answers
56 views

Are conditional effects the same as main effects when using orthogonal contrast codes for categorical predictors?

I ran into a presentation discussing the difference between conditional (or simple) effects and main effects when interpreting regression output in the presence of interaction terms. http://www.lrdc....
0
votes
1answer
95 views

Setting up contrasts in lmer?

0 I have 139 subjects (ID), with measurements taken at two time points (Time1, Time2), at 148 brain regions, a dependent measure called volume, and a covariate called thickness. Each subject has 148 ...
0
votes
1answer
70 views

Use contrasts in a 2x2 ANOVA to test directional hypotheses

I think I have a rather simple question. I have a 2x2 ANOVA and I am both interested in the main effects and their interaction. Usually, I'd simply run the ANOVA (type 3) to see whether main effects ...
1
vote
1answer
67 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 ...
0
votes
1answer
44 views

Orthogonal contrasts, ANOVA, why are there only as many contrasts there are degrees of freedom?

For example, if I have the data $$ \begin{array}{l|l|l|l|l|l|l} A & low & & medium & & high & \\ \hline B & standard & new & ...
0
votes
0answers
22 views

Predictor removed because of rank-deficiency in “lmer” model? [duplicate]

In my current research project, I am looking at the impact of different within-subject experimental manipulations on distance perception. The experiment comprised 40 subjects each providing 144 ...
2
votes
2answers
88 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 ...
0
votes
0answers
19 views

How to analyze contrasts? (Factorial and One-way ANOVA)

I have a statistics exam soon. I've been plowing through all kinds of statistical tests but I'm blocking hard on one "process" relevant to ANOVA's. I just don't understand, and I will give you one ...
0
votes
1answer
33 views

How to break down a 2-way factorial interaction into an interaction contrast

Assume the following dataset: ...
0
votes
0answers
61 views

Negative variance of linear combination of regression coefficients

I'm going crazy over this so I hope someone can help me.. First a presentation of my case: I have a complex multiple regression model with 4 predictors (some terms that don't concern this issue are ...
0
votes
1answer
22 views

Is it okay to combine dummy coding and sequence coding?

I have a model with two categorical variables. Each one has three levels. Iv1 has a natural reference category so I would like to use dummy coding, and compare level 2 to level 1, and level 3 to level ...
1
vote
1answer
845 views

Differences between Simple Effects, Pairwise Comparisons, and planned/post hoc comparisons?

I am very confused as to the differences between simple effects, pairwise comparisons, and planned/post hoc comparisons. From what I understand, after running an ANOVA, you would use one of these to ...
1
vote
2answers
56 views

Significant main effects lost during ANCOVA due to interaction terms. Is type III the way to go?

I have some experimental data which I am analysing using step wise multiple regression (ANCOVA) in R using the step function. The response data (wp) is the leaf ...
1
vote
0answers
143 views

What's special about orthogonal contrasts?

In my Design and Analysis class we talked about orthogonal contrasts when it comes to running an ANOVA for one factor of several levels. I understand what it means for two contrasts to be orthogonal. ...
1
vote
1answer
72 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 ...
1
vote
1answer
23 views

Does it make sense to do a polynomial contrast on a continuous time variable?

I tried running a few polynomial contrasts in SAS for a continuous time variable for linear, quadratic, cubic and quartic contrasts and the F values for each were the same. When I used categorical ...
1
vote
1answer
157 views

Dummy coding versus contrasts: which compares treatment with control?

I have a data set where I want to compare different treatments with a certain baseline. So I basically have a linear model (ANOVA) like this: outcome = b_0 + sum_i(b_i * x_i) with b_i the fitted ...
1
vote
0answers
39 views

Fit GLM using part of the data

I have a single-cell RNA-seq experiment with five different treatments. The treatments are likely to result in different cell types, although this isn't known at this stage of the analysis. Regardless,...
0
votes
1answer
264 views

significance of slope (different than zero) in triple interaction (with factors) for mixed model

I have the following mixed model (package {lme4} in R) : ...
0
votes
0answers
153 views

How to perform general linear hypothesis test on fitted model with treatment contrasts in R?

How should I perform a general linear hypothesis test in R on the coefficients of a fitted model that are represented by treatment contrasts? In particular with regard to the differences between the ...
1
vote
0answers
17 views

Multiple contrasts [closed]

We are currently doing 2 contrasts for a condition variable (3 levels) ...