d.- Poshoc Contrast

Objetive

Performs post-hoc contrasts. This is done for the main effects and simple effects (interaction). Also allows orthogonal contrasts defined by the user or trend for a selected fixed effect factor.

Pair to Pair contrasts

We start from the Split-plot multifactorial ANOVA and wish to perform post-hoc contrasts for the significant effects of the ANOVA summary table: hour and treatment:phase interaction.

Anova.fnc(dat, between.factor=between.factor, type=2,

within.factor=within.factor, col.start.rm=3,

poshoc=c('hour','treatment:phase'))

We add the argument poshoc specifying the effects names we want to compare separated by the comma (,). Note that the name of the interaction is between quotes and the factors that make it up are separated by a colon (:).

res.pos.hoc.Anova

The user can also apply post-hoc contrasts for triple interactions. The factor firstly introduced it will be used as pivot (gender in the following example). If we want other factor as pivot, just change the order in the interaction (eg 'treatment: gender: phase').

Anova.fnc(dat, between.factor=between.factor, type=2,

within.factor=within.factor, col.start.rm=3,

poshoc='gender:treatment:phase')

res.pos.hoc.interacción.triple

Orthogonal Constrast

USER-DEFINED

Let's create an orthogonal family to test the fixed effect treatment. We will do it through a list that cointains the name and the weights-vector for each of the J-1 orthogonal contrasts.

contrasts= list( cont.vs.AB =c(-2,1,1),

A.vs.B = c(0,1,-1))

In the first contrast cont.vs.AB we want to compare control group against treated groups A and B. In the second (A.vs.B orthogonal to the first) we compare the treated groups A vs. B.

Each contrast labels are arbitrary but obviously will be very useful the related with comparisons to make.

Anova.fnc(dat, between.factor=between.factor, type=2,

within.factor=within.factor, col.start.rm=3,

poshoc='treatment', contrasts=contrasts)

You can test the result of attempting these incorrect contrasts:

1.- The second constrast A.vs.B do not have 3 weight.

contrasts= list(cont.vs.AB =c(-2,1,1), A.vs.B = c(1,-1))

2.- The first contrast cont.vs.AB do not sum zero.

contrasts= list(cont.vs.AB =c(2,1,1), A.vs.B = c(0,1,-1))

TREND-CONTRASTS

En la tabla resumen del Anova Split-plot realizado podemos ver que el factor hora ha resultado significativo (p < 0.001). Dado que se trata de una variable cuantitativa equi-espaciada temporalmente podemos plantearnos un análisis de tendencia para este efecto. Para ello debemos indicar en el argumento contrastes el valor 'tendencia'.

In the summary table for the Split-plot ANOVA previously completed we see that the factor hour was significant (p <0.001). Since this is temporarily- equi-spaced quantitative variable we can ask for a trend analysis for this variable. To run this trend analysis we add in the contrasts argument the value 'trend'.

Anova.fnc(datos, between.factor=between.factor, type=2,

within.factor=within.factor, col.start.rm=3,

poshoc='hour', contrasts='trend')