## 2.2 Main analysis

Proceeding to the main questions of interest, we carry out a two-way MANOVA of the responses
`Years`

and `Serious`

in relation to the independent variables
`Attr`

and `Crime`

.

```
# influence of Attr of photo and nature of crime on Serious and Years
<- lm( cbind(Serious, Years) ~ Attr * Crime, data=MockJury)
jury.mod2 Anova(jury.mod2, test="Roy")
#>
#> Type II MANOVA Tests: Roy test statistic
#> Df test stat approx F num Df den Df Pr(>F)
#> Attr 2 0.0756 4.08 2 108 0.020 *
#> Crime 1 0.0047 0.25 2 107 0.778
#> Attr:Crime 2 0.0501 2.71 2 108 0.071 .
#> ---
#> Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
```

We see that there is a nearly significant interaction between `Attr`

and `Crime`

and a strong effect of `Attr`

.

`heplot(jury.mod2)`

The HE plot shows that the nearly significant
interaction of `Attr:Crime`

is mainly in terms of
differences among the groups on the response of `Years`

of sentence,
with very little contribution of `Serious`

. We explore this interaction in a bit more detail
below. The main effect of `Attr`

is also dominated by differences among groups
on `Years`

.

If we assume that `Years`

of sentence is the main outcome of interest,
it also makes sense to carry out a step-down test of this variable by itself,
controlling for the rating of seriousness (`Serious`

) of the crime.
The model `jury.mod3`

below is equivalent to an ANCOVA for `Years`

.

```
# stepdown test (ANCOVA), controlling for Serious
<- lm( Years ~ Serious + Attr * Crime, data=MockJury)
jury.mod3 t(coef(jury.mod3))
#> (Intercept) Serious AttrAverage AttrUnattractive CrimeSwindle
#> [1,] 0.011612 0.83711 0.39586 0.60285 -0.26302
#> AttrAverage:CrimeSwindle AttrUnattractive:CrimeSwindle
#> [1,] -0.53701 2.5123
Anova(jury.mod3)
#> Anova Table (Type II tests)
#>
#> Response: Years
#> Sum Sq Df F value Pr(>F)
#> Serious 379 1 41.14 3.9e-09 ***
#> Attr 74 2 4.02 0.021 *
#> Crime 4 1 0.43 0.516
#> Attr:Crime 49 2 2.67 0.074 .
#> Residuals 987 107
#> ---
#> Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
```

Thus, even when adjusting for `Serious`

rating, there is still a
significant main effect of `Attr`

of the photo, but also a hint of
an interaction of `Attr`

with `Crime`

. The coefficient for
`Serious`

indicates that participants awarded 0.84 additional
years of sentence for each 1 unit step on the scale of seriousness of crime.

A particularly useful
method for visualizing the fitted effects in such univariate response
models is provided by the `effects`

. By default `allEffects()`

calculates the predicted values for all high-order terms in a given
model, and the `plot`

method produces plots of these values for
each term. The statements below produce Figure 2.5.

```
library(effects)
<- allEffects(jury.mod3)
jury.eff plot(jury.eff, ask=FALSE)
```

The effect plot for `Serious`

shows the expected linear relation
between that variable and `Years`

. Of greater interest here is the nature
of the possible interaction of `Attr`

and `Crime`

on `Years`

of sentence, controlling for `Serious`

.
The effect plot shows that for the crime of Swindle, there is a much
greater `Years`

of sentence awarded to Unattractive defendants.