Lecture 12: ANCOVA Flashcards
ANCOVA: wat is het?
mix tussen ANOVA en regression. ANCOVA evaluates whether population means of a dependent variable (DV) are equal across levels of a categorical independent variable (IV) often called a treatment, while statistically controlling for the effects of other continuous variables that are not of primary interest, known as covariates (CV).
dus ANCOVA = ANOVA + controlling for covariates
wat voor variabelen heb je bij een ANCOVA
1 dependent variable
1 or more independent variables
1 or more covariates
By adding a covariate, we….
reduce error/residual in the model. (because a covariate can bias your results)
hypothesen bij ANCOVA
H0 = predict with the total mean
H1 = predict with the group means
als deze anders zijn is er een systematic difference between the groups
overfitting=
when you try to fit noise -> bijvoorbeeld als je er van uit gaat dat iedereen in een stoel op 5 mei jarig is, omdat een iemand die in die stoel zat op 5 mei jarig is
wat voor soort variabele is dependent bij ANCOVA
mean -> continuous
wat voor soort variabele is independent bij ANCOVA
categorical
least squares =
een lijn die het kleinste verschil vanaf de mean laat zien, dus de lijn die het beste past.
wat zijn de covariates altijd voor level
categorical!! (Net als independent)
assumptions ANCOVA=
ANOVA:
- continuous variable
- random sample
- normally distributed (shapiro wilk/QQ plots)
- equal variance within groups (levenes)
ANCOVA extra:
- independence of covariate and independent var
- homogeneity of regression slopes
hoe zie je independence of covariate and treatment effect
- No difference on ANOVA with covar and independent variable
- Matching experimental groups on the covariate
“no difference on ANOVA with covar and independent variable” waarom?
- When treatment groups differ on the covariate, putting the covariate into the analysis will not ‘control for’ or ‘balance out’ those differences
- This situation arises mostly when
participants are not randomly assigned to experimental treatment conditions - This problem can be avoided by randomizing participants to experimental groups, or by matching experimental groups on the covariate
hoe kan je homogeneity of regression slopes zien
- Visual: scatterplot dep var * covar per condition
- Testing: interaction indep. var * covar
waar moet je op letten bij het adden van covariates
you do not want to add the covariate if the variance of the covariate overlaps with variance of the independent variable -> dan krijg je niet het ‘pure’ effect van de independent variable (en dat is wat je wil doen met covariates)
wat wil je wel van een covariate
dat hij de unexplained variance uitlegt. (dus niet de variance explained by the indepenent variable)
wat is het doel van dummy variables
translate a categorical variable -> additional column in the data, variable encoded into 0 and 1. dan krijg je een binary division of your categorical variables.
hoeveel dummy variables heb je nodig
g - 1
dus 3 condities = 2 dummy variables
hoe kan je een model herschrijven als een linear model
outcome = model + error
model = independent + covariate
hoe kan je het herschrijven als formal model
y = b0 + b1dummy1 + b2dummy2 + b3covar
ANOVA = linear regression!!!
je kan een linear regression doen met categorical predictors, of ANOVA met een continous predictor etc.
b0=
intercept, anchoring point
b0 is equal to the average of the ….
group that you do not create a dummy variable for
wat geeft een dummy aan
de observed difference between two of the groups.
if we add different predictor variables in the model, we will predict differently!! we will predict better, or not so much better
oke (dit is het belangrijkste om te onthouden)
adding more predictors leads to …. variance
better explanation of the variance.
error variance=
difference between what we predict, and what we observe.
het hele doel van ANOVA en ANCOVA is to decompose the total sum of squares between the model error and the model accuracy
oke
wat voor extra stap doe je nog bij een ANCOVA
je kijkt naar de SS.covar, en vergelijkt deze met de SS.group (=categorical predictor) -> hoeveel error is explained door independent, en hoeveel door de covariate?
waarvoor werden dummy variables hier genoemd
omdat ze wilden laten zien dat anova = regression. je kan een anova veranderen in een regression door de variabelen te veranderen in dummy variables.
hoe kan je homogeneity: equal variances within groups testen?
- Levene’s test
- descriptive statistics: kijken of de standard deviations hetzelfde zijn.
hoe test je independence between covariate and independent variable in JASP
door een ANOVA uit te voeren:
dependent variable = covariate
fixed factors = independent variable
is hier een association? -> niet significant = goed.
wat is homogeneity of regression slopes
the same relationship between the covariate and the dependent variable for different levels of the group variable
!!!
hoe kan je homogeneity of regression slopes in JASP testen via visualisatie
descriptives plots van de ANCOVA
horizontal axis = covariate
seperate lines = independent variables
dan kijken of de regression line verschillend is voor verschillende levels van de independent variables. -> deze zouden parallel aan elkaar moeten zijn.
hoe kan je homogeneity of regression slopes in JASP testen via formules
ANCOVA -> onder kopje ‘model’ de interactie toevoegen door samen te selecteren. dan kijken of deze significant is.
wat als de lijnen niet parallel zijn aan elkaar
dan is homogeneity of regression slopes assumption violated
residuals =
error of the model
model sums of squares in ANCOVA tabel
de covariate + dependent variable bij elkaar opgeteld.
wat is de nulhypothese bij een ANCOVA?
we are comparing the full model with the independent variable to the model without the independent variable
marginal means =
means that are estimated from the model, whilst keeping the covariate equal across the groups (dus correcting for the presence of a covariate).
waar worden marginal means bij gebruikt
voor contrasts and post hoc tests.