Hypotheses about cell means in a two-way design, with an intercept and interactions, using group_means() and :=.
The research question
In the previous examples, we removed the intercept so that every coefficient was a group mean. With two or more factors, or when you want to keep the usual parameterization with an intercept, the coefficients are differences between groups. Writing hypotheses about group means is then less straightforward. restriktor has two tools for this: group_means() and the := operator.
We use the ToothGrowth dataset that comes with R: the length of odontoblasts (cells responsible for tooth growth) in 60 guinea pigs that received vitamin C at one of three doses (0.5, 1 or 2 mg/day), either as orange juice (OJ) or as ascorbic acid (VC).
We expect that the tooth length increases with the dose, for both supplements:
Restriktor: restricted hypothesis tests:
Multiple R-squared remains 0.794
Constraint matrix:
(Intercept) suppVC dose1 dose2 suppVC:dose1 suppVC:dose2 op rhs active
1: 0 0 1 0 0 0 >= 0 no
2: 0 0 -1 1 0 0 >= 0 no
3: 0 0 1 0 1 0 >= 0 no
4: 0 0 -1 1 -1 1 >= 0 no
Overview of all available hypothesis tests:
Global test: H0: all parameters are restricted to be equal (==)
vs. HA: at least one inequality restriction is strictly true (>)
Test statistic: 207.7859, p-value: <0.0001
Type A test: H0: all restrictions are equalities (==)
vs. HA: at least one inequality restriction is strictly true (>)
Test statistic: 192.2139, p-value: <0.0001
Type B test: H0: all restrictions hold in the population
vs. HA: at least one restriction is violated
Test statistic: 0.0000, p-value: 1
Joint Type A and Type B test (Wolak, 1989, Theorem 1):
joint tail probability under H0: Rb = r (least favorable null)
Pr[Type B >= 0.0000, Type A >= 192.2139]: p-value: <0.0001
Type C test: H0: at least one restriction is false or active (==)
vs. HA: all restrictions are strictly true (>)
Test statistic: 2.0689, p-value: 0.02168
Note: Type C test is based on a t-distribution (one-sided),
all other tests are based on a mixture of F-distributions.
Step 4 – interpret the results
Type B is not rejected (\(\bar{F}\) = 0.00, p = 1.000): the cell means are ordered as expected.
Type A is rejected (\(\bar{F}\) = 192.21, p < .001).
Even Type C is rejected (\(t\) = 2.07, p = .022): every single step up in dose is supported, for both supplements.
Conclusion: tooth length increases with the dose of vitamin C, both for orange juice and for ascorbic acid.
The same hypothesis with the GORIC
In goric(), you can use the mu_ names directly, without the := definitions; they are added automatically. This makes it easy to compare several hypotheses. Suppose that a second theory says that orange juice is also better than ascorbic acid at the two lower doses:
restriktor (0.7): generalized order-restricted information criterion:
Results:
Values:
model loglik penalty goric
1 H1 -159.353 4.667 328.039
2 H2 -159.353 4.248 327.201
3 unconstrained -159.353 7.000 332.706
Weights:
model loglik.weights penalty.weights goric.weights
1 H1 0.333 0.382 0.382
2 H2 0.333 0.581 0.581
3 unconstrained 0.333 0.037 0.037
goric.weights_without_unc
1 0.397
2 0.603
3
Conclusion:
- The order-restricted hypothesis 'H2' is the best in the set, as it has
the highest GORIC weight.
- Since 'H2' has a higher GORIC weight than the unconstrained hypothesis,
it is not considered weak. We can now inspect the relative support for
'H2' against the other order-restricted hypotheses:
* 'H2' is 1.520 times more supported than 'H1' (This relative support
reached its maximum, see Note).
---
Additional information:
- Note: Hypotheses 'H1' and 'H2' have equal log-likelihood values. This
indicates that they overlap and that the ratio of their GORIC weights
reached its maximum.
- Since the best hypothesis overlaps with one or more other hypotheses, we
recommend evaluating the overlap (or best hypothesis) vs. its complement
(for the best hypothesis, see the post-hoc analysis mentioned below). For
more information and an example, see the vignette
'Guidelines_GORIC_output'; to open it, run
vignette("Guidelines_GORIC_output", package = "restriktor").
- The benchmark() function can be used to label the height of the output,
for example, the height of the ratio(s) of weights (e.g., to say whether
that value denotes medium, high, or very large evidence). More details
can be found in the vignette 'Guidelines_GORIC-benchmarks'; to open it,
run vignette("Guidelines_GORIC-benchmarks", package = "restriktor").
- The results (including the conclusion) of the post-hoc analysis, in which
the best hypothesis ('H2') is evaluated against its complement, are
stored in the goric object. To see them, use:
out.goric$posthoc
Both hypotheses fit the data equally well (the same log-likelihood): the sample means satisfy all restrictions of \(H_2\). But \(H_2\) is more specific and therefore has a smaller penalty. \(H_2\) is 1.52 times more supported than \(H_1\). Note that \(H_2\) is nested in \(H_1\): it contains all restrictions of \(H_1\) plus two more. Then \(H_2\) can never fit better than \(H_1\), and the ratio of weights can never exceed \(\exp(\text{penalty}_{H_1} - \text{penalty}_{H_2})\), here 1.52. See the GORIC(A) guidelines for how to interpret such overlapping hypotheses.