A contrast is a linear combination of parameters or parameter estimates, with the coefficients in the linear combination known. Often used to test focused hypotheses.

learn more… | top users | synonyms

0
votes
0answers
18 views

Helmert contrasts: Each level compared to mean of subsequent levels, or mean of previous levels?

My question is what is the accepted definition of Helmert (and Reverse Helmert)? UCLA stats define Helmert contrasts thus: "Helmert coding compares each level of a categorical variable to the mean of ...
0
votes
1answer
46 views

R function survfit(): give newdata reference values for factors with >2 levels?

The goal is to plot separate survival curves for each level of a categorical variable in R, using a coxph model including the variable and a second categorical variable with >2 levels. If the second ...
2
votes
1answer
41 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
0answers
36 views

Choosing contrast coding in R

I am working on a data set with categorical variables. To apply ANN, I want to apply contrast coding to those variables. But how do I choose between coding functions in R (sum, helmert, treatment ...
1
vote
1answer
46 views

Why does “orthogonality” matter when using poly(x,degrees=1)?

I think I understand why orthogonality matters when doing regression with polynomial fits (so that the linear and quadratic, cubic, etc... can be evaluated independently). However, I don't understand ...
0
votes
0answers
17 views

Contrasts / Post Hoc Tests for three way repeated measures ANOVA

I have three factors A B and C with 2, 2 and 3 levels. A and C have significant main effects, B is not significant, interaction A*C is significant, the others are not. Now I want to know how to ...
2
votes
1answer
39 views

Testing linear restriction of parameters of ordered logistic regression models

Given the ordered logistic regression model: $outcome=\beta_0+\beta_1X_1+\beta_2X_2+\beta_3X_1*X_2$ Can I test linear restrictions on the parameters? For example I would like to test $H_0: ...
0
votes
0answers
11 views

Hypothesis Testing $\mu_{..}$ vs $\mu_{i.}$ for all $i$ In Context of Sample Surveys

I have been tasked with creating a table of p-values, where each cell is a p-value testing $\mu_{..}$ = $\mu_{i.}$, for each level of $i$. Essentially, $\mu_{..}$ is total average and $\mu_{i.}$ is an ...
1
vote
1answer
20 views

successive difference (aka repeated) contrasts with reference group

I have data from an experiment where performance y on two different devices was measured over three successive sessions. The 2x3 design is completely within-subject (see simulation code at the ...
1
vote
0answers
32 views

Imposing restriction over some regressors in a linear model?

I have the following problem: Starting with a multivariate linear model $Y=\beta_1x_1+\beta_2x_2+\beta_3x_3+\beta_4x_4+\alpha_1x_5+\alpha_2x_6+\alpha_3x_7+\alpha_4x_8+\epsilon$ and $$X=\begin{pmatrix} ...
0
votes
1answer
102 views

Why the discrepancy between the classic definition of contrast and that in R

According to Wikipedia, contrast is defined as follows: Let $\theta_1$,$\ldots$,$\theta_t$ be a set of variables, either parameters or statistics, and $a_1$,$\ldots$,$a_t$ be known constants. ...
1
vote
1answer
32 views

Why don't the following contrasts and linear models behave as I expected?

I am trying to understand how contrasts work, so I ran a small simulation using the following R code: ...
0
votes
0answers
16 views

Performing Interaction Contrasts on mixed-models in R

I need to run interaction contrasts on the following data set. It is a mixed design with the dependent variable a questionnaire score measured across five test days (within-subjects variable 'Day'). ...
0
votes
0answers
24 views

Contrast 3 is orthogonal to Contrast 1, Contrast 2

The question is using orthogonal contrast: 4 different paint (1,2,3,4) surface with 2 levels(Asphalt, concrete) for contrast 1: I would like to compare paint 1 and paint 2 for contrast 2: I would ...
1
vote
1answer
136 views

Interpreting GLM Interaction Contrasts in R (using glht)

I am trying to do a BACI analysis on count data, and I am having trouble interpreting the output from multcomp::glht. I don't understand how the contrast's coefficients are related to effect size ...
3
votes
4answers
494 views

Test if two coefficients are statistically different in logistic regression?

I am doing the logistic regression with logit link in MATLAB [b, ~, stats] = glmfit(X, [Y N], 'binomial', 'link', 'logit'); I can find the $p$-values for each ...
0
votes
1answer
59 views

How to choose contrasts for nominal categorical Independent variable so that it results in uncorrelated dummies

I have a nominal categorical predictor and a continuous dependent variable..I want to perform linear regression using lm in R. If the contrasts are such that the resulting dummy variables are ...
3
votes
0answers
61 views

Is there a consensus on adjusting alpha for multiple contrasts if the main effect is significant?

After talking to a couple of statisticians, reading some book sections, internet articles, and forums like this, I am still unclear about multiplicity adjustments of post hoc tests and contrasts. ...
0
votes
0answers
34 views

Parameterization of the ANOVA model and interpretation of the overall F-test

I've recently encountered the following concept regarding linear regression: the inclusion of an intercept will change the interpretation of both the overall F-test and the individual parameter ...
3
votes
2answers
61 views

Geometric Interpretation of Orthogonal Contrasts in ANOVA

I was trying to understand orthogonal contrasts in ANOVA following the article by Harry M. Schey "A Geometric Description of Orthogonal Contrasts in One-Way Analysis of Variance" in The American ...
0
votes
0answers
43 views

Are the statistical words contrasts and post hoc synonymous?

I have implemented a linear mixed-effects model using lmer{} model in R and used glht to to ...
0
votes
0answers
12 views

How to determine values of coefficients for a comparsion using factorial design?

I think my problem is best answered by answering the following example but the more general the answer and explanation the better: Given 2 factors X and Y, x with 2 levels x1 x2 and Y with three ...
2
votes
0answers
96 views

Polynomial contrast in mixed anova with type III SS

I'm trying to replicate SPSS output in R for a mixed ANOVA with a polynomial contrast to test a linear trend. I fitted a mixed ANOVA in R (see code below), but I can't figure out how to get the ...
0
votes
0answers
25 views

How can I make an ANCOVA in R (Prior to a Cox ph model)?

I want to make an ANCOVA analysis of the survival rate of flies after being on a bad diet for the first 21 days of their lives compared to those always on a normal diet. I have studied the responses ...
0
votes
2answers
71 views

R lm() nested formulas give different results

Online sources show two supposedly equivalent ways to write an R linear model formula with nested factors: ...
0
votes
2answers
219 views

How to compare nested factor levels to mean, not to first level, and how to test the last nested level in R lm()

I have two factors j (with 3 levels A, B, C) and k (with 3 levels M, N, O), with k nested within j. Level A of j is the reference level and it has only one k level, M, in it. What I want to test ...
0
votes
0answers
7 views

contrasts between two grouped levels and the other six levels in a mixed 3x3 ANOVA in SPSS

I have a mixed ANOVA with 3 between subjects groups (control, m, s) , and 3 within subjects factors of stimulus type (3 levels), orientation (4), eccentricity (8 levels). i would like to investigate ...
0
votes
0answers
69 views

Why do contrasts or contrast sum of squares have one degree of freedom?

I have repeatedly seen that contrasts or contrast sum of squares are mentioned to have one degree of freedom. I'm wondering why this is the case. Is there an obvious explanation? Shouldn't they have ...
3
votes
1answer
125 views

Justification for default contr.poly() polynomial contrasts in R

In R, one can use contr.poly() to create a set of orthogonal contrast codes for testing linear and higher order effects of categorical factors: ...
2
votes
0answers
58 views

non-orthogonal contrasts in R

I am running ANOVA and doing non-orthogonal contrasts. Non-orthogonal contrasts are not supposed to completely partition the sum of squares of treatments. But what I got from R is not what is supposed ...
0
votes
0answers
43 views

Comparing linear contrast or slopes

I have a very simple question that is bothering me for a while. Imagine if you have a group with N participants, tested on an indice of performance (such as reaction times RT) according to I various ...
1
vote
0answers
66 views

How to do contrasts with weighted observations in R's linear model function lm()

As part of a simple simulation study, I have the following lines of code in R: ...
0
votes
0answers
43 views

How to get the significance of the last group in effect coding (contr.sum in R)?

I built in R a model similar to: ...
0
votes
0answers
12 views

Significance of a group of variables

I know how to do a significance contrast of a group of variables but if I see a lack of significance in two variables (for example in R the t test show when you type summary(lm(y~x1+x2+...+xk))) ...
2
votes
1answer
137 views

How do I contrast code for a factor where one level is the application of both of two others?

I have a factor 'Music' that has four levels: none, piano, guitar, and mixed. Subjects gave a response hearing no music, piano only, guitar only, or piano and guitar, so I want to create an lmer model ...
1
vote
0answers
135 views

Interaction with contrast and dummy coding

I have a question regarding the interpretation of an interaction using categorical variables where one is dummy coded (0, 1) and the other is contrast coded. The variables are: Var1: 3 levels, ...
0
votes
0answers
334 views

Specifying interaction contrasts for within x between terms in SPSS

I am trying to analyse a dataset with 3 groups of subjects and one repeated measure with 6 levels (accuracy at identifying 6 different emotions). I am using the GLM command from SPSS to do this, which ...
1
vote
0answers
96 views

How to create dummy variables for interaction term between categorical variables?

I'm building a logistic regression model estimating the probability of hospitalization based on several predictor variables, including indicator variables for various diagnosis categories (coded as ...
2
votes
0answers
59 views

Possible to code contrasts comparing each level to grand mean with no reference category?

I'm working on a health care outcome regression model using the deviation contrast scheme described on the UCLA SAS help page here for a collection of dichotomous predictor variables measuring medical ...
2
votes
2answers
98 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 ...
0
votes
1answer
69 views

Refitting with different contrasts vs. pairwise comparisons

Say, I fit a linear or generalised linear model in R with dummy coding (contr.treatment for ...
0
votes
0answers
67 views

SPSS Contrasts for a Five-Way Within-Subjects ANOVA (Yes, You read correctly)

I have a 4 x 4 x 2 x 2 x 2 repeated measures design and I'm trying to test a contrast for just the first variable (here called "SOA"), averaging over the others, in SPSS. Initially, I thought it ...
1
vote
0answers
398 views

Linear trend in SAS using contrast

I've been struggling with this problem for a couple of hours, and I could use some advice. I have a linear regression model with two continuous predictors and a categorical one (with 4 levels). I ...
1
vote
1answer
261 views

Orthogonal contrasts for four levels - are Helmert contrasts orthogonal?

I am planning to do a 2-way mixed ANOVA with the within-subjects factor having four levels. Since the exact data do not matter, I hope to suffice by only providing a general question. On my ...
3
votes
1answer
303 views

Design of matrix of contrasts in R

I am doing some post-hoc comparisons (in lme4, but here I'll just present a simple linear model), and I am having a hard time making sure that I am building the right matrix of contrasts to test ...
1
vote
0answers
71 views

Specific contrasts in mixed model with interaction

I have a dataset consisting of two groups tested across three days. Therefore I run a linear mixed model as follows: ...
3
votes
0answers
491 views

R model.matrix and makeContrast. Understanding model and possible contrast

I have measurements from 12 mice, grouped in two conditions. I each mouse I have measurements from 4 tissues. The design is not balanced, 5 mice in condition1 and 7 in condition2. After reading the ...
1
vote
0answers
58 views

Logistic regression: Trying to use mean logit as reference group

Question I would like to do a logistic regression where the independent variables are compared to the mean logit, rather than the logit being compared a certain reference group. Example The example ...
1
vote
0answers
43 views

combining and contrasting time course GLMs using R

I am analyzing some time course data in which I have set up a GLM using R for each subject. Each GLM I want to run is an attempt to extract estimates of different behavioral conditions effects on the ...
2
votes
1answer
534 views

Polynomial contrasts for regression

I cannot understand the usage of polynomial contrasts in regression fitting. In particular, I am referring to an encoding used by R in order to express an interval ...