Skip to main content

Ex. 8 – Robust inference

Heteroskedasticity-robust standard errors, robust MM-estimation and bootstrapped p-values, and what happens when one restriction fails.

The research question

We use the Burns data again (see example 5): the post-traumatic stress symptoms (PTSS) of 278 mothers of children with burns. The expectation is that PTSS increase with the mother’s feelings of guilt and anger, and with the size of the burn (TBSA, percentage of total body surface area), controlling for the child’s gender and age:

\[ H_1: \beta_{TBSA} \geq 0,\quad \beta_{guilt} \geq 0,\quad \beta_{anger} \geq 0. \]

Step 1 – fit the unrestricted model

library(restriktor)

fit <- lm(PTSS ~ gender + age + TBSA + guilt + anger, data = Burns)
round(summary(fit)$coefficients, 3)
            Estimate Std. Error t value Pr(>|t|)
(Intercept)   18.834      1.924   9.790    0.000
gender         1.491      1.060   1.407    0.161
age            0.162      0.087   1.854    0.065
TBSA          -0.099      0.056  -1.784    0.076
guilt          3.561      0.610   5.840    0.000
anger          3.379      0.601   5.619    0.000

Guilt and anger have clearly positive effects. The estimated effect of TBSA, however, is negative (-0.099).

Step 2 – test the hypothesis

H1 <- ' TBSA > 0; guilt > 0; anger > 0 '

out <- iht(fit, constraints = H1)
out

Restriktor: restricted hypothesis tests: 


Multiple R-squared reduced from 0.224 to 0.215 

Constraint matrix:
   (Intercept) gender age TBSA guilt anger    op rhs active
1:           0      0   0    1     0     0    >=   0    yes
2:           0      0   0    0     1     0    >=   0     no
3:           0      0   0    0     0     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: 75.2375,   p-value: <0.0001

Type A test: H0: all restrictions are equalities (==) 
         vs. HA: at least one inequality restriction is strictly true (>)
       Test statistic: 73.6349,   p-value: <0.0001

Type B test: H0: all restrictions hold in the population
         vs. HA: at least one restriction is violated
       Test statistic: 3.1819,   p-value: 0.1551

Joint Type A and Type B test (Wolak, 1989, Theorem 1):
         joint tail probability under H0: Rb = r (least favorable null)
       Pr[Type B >= 3.1819, Type A >= 73.6349]:   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: -1.7838,   p-value: 0.9622

Note: Type C test is based on a t-distribution (one-sided), 
      all other tests are based on a mixture of F-distributions.

Step 3 – interpret the results

In the constraint matrix, the restriction on TBSA is active: the restricted estimate is set to the boundary (0), because the data point in the other direction.

  • Type B is not rejected (\(\bar{F}\) = 3.18, p = .155). The violation of the TBSA restriction is small enough to be explained by chance, so the data are not in conflict with \(H_1\).
  • Type A is rejected (\(\bar{F}\) = 73.63, p < .001): at least one effect is positive.
  • Type C is not rejected (\(t\) = -1.78, p = .962): there is no evidence that all three effects are positive.

Conclusion: the data support positive effects of guilt and anger. The data are not in conflict with a positive effect of TBSA, but they do not support it either. Type A and B together only say that the hypothesis as a whole is in line with the data and that some effect is present. Type C, or a look at the individual restrictions, tells you which parts are supported.

Model selection with the GORIC

The difference between “not in conflict with” and “supported by” becomes clear when we compare \(H_1\) with its complement:

out.goric <- goric(fit, hypotheses = list(H1 = H1),
                   comparison = "complement")
out.goric$result
       model    loglik  penalty    goric loglik.weights penalty.weights
1         H1 -975.4161 5.468865 1961.770      0.1656706       0.7649027
2 complement -973.7994 6.648614 1960.896      0.8343294       0.2350973
  goric.weights
1     0.3924853
2     0.6075147

The complement is 1.55 times more supported than \(H_1\). Because the estimated TBSA effect is negative, \(H_1\) fits less well than its complement, and the GORIC does not support \(H_1\) as a whole. The Type B test could not reject \(H_1\), but that only means that the violation could be due to chance. This also shows why every restriction in a hypothesis should be motivated by theory: one violated restriction lowers the support for the hypothesis as a whole.

Heteroskedasticity-robust standard errors

The variance of the residuals may not be the same for all mothers (heteroskedasticity). Then the standard errors of the restricted estimates are biased. With se = "HC3", restriktor computes heteroskedasticity-robust standard errors (requires the sandwich package):

restr.HC <- restriktor(fit, constraints = H1, se = "HC3")
summary(restr.HC)

Call:
conLM.lm(object = object, constraints = constraints, se = "HC3")

Restriktor: restricted linear model:

Residuals:
            [,1]
Min    -28.80270
1Q      -4.38272
Median  -0.29478
3Q       5.25461
Max     23.74107

Coefficients:
             Estimate Std. Error t value  Pr(>|t|)    
(Intercept) 18.135509   2.055639  8.8223 < 2.2e-16 ***
gender       1.420455   1.122047  1.2659    0.2066    
age          0.140223   0.092496  1.5160    0.1307    
TBSA         0.000000   0.000000  0.0000    1.0000    
guilt        3.522460   0.592086  5.9492 8.263e-09 ***
anger        3.425468   0.654266  5.2356 3.295e-07 ***
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Residual standard error: 8.1716 on 272 degrees of freedom
Heteroskedastic robust standard errors: HC3 
Multiple R-squared reduced from 0.224 to 0.215 

Generalized order-restricted information criterion: 
   Loglik   Penalty     goric 
-975.4161    5.4689 1961.7699 

The robust standard errors are only used for the estimates. The informative hypothesis tests do not use them; for tests that are robust against non-normal errors and outliers, see the next sections.

Robust MM-estimation

Outliers can strongly affect least squares estimates. With rlm() from the MASS package and method = "MM", the model is estimated robustly, and restriktor computes robust test statistics:

library(MASS)
fit.rlm <- rlm(PTSS ~ gender + age + TBSA + guilt + anger,
               data = Burns, method = "MM")
out.rlm <- iht(fit.rlm, constraints = H1)
out.rlm

Restriktor: restricted hypothesis tests: 


Multiple R-squared reduced from 0.216 to 0.206 

Constraint matrix:
   (Intercept) gender age TBSA guilt anger    op rhs active
1:           0      0   0    1     0     0    >=   0    yes
2:           0      0   0    0     1     0    >=   0     no
3:           0      0   0    0     0     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: 65.2152,   p-value: <0.0001

Type A test: H0: all restrictions are equalities (==) 
         vs. HA: at least one inequality restriction is strictly true (>)
       Test statistic: 64.4984,   p-value: <0.0001

Type B test: H0: all restrictions hold in the population
         vs. HA: at least one restriction is violated
       Test statistic: 3.0357,   p-value: 0.1664

Joint Type A and Type B test (Wolak, 1989, Theorem 1):
         joint tail probability under H0: Rb = r (least favorable null)
       Pr[Type B >= 3.0357, Type A >= 64.4984]:   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: -1.6685,   p-value: 0.9518

Note: Type C test is based on a t-distribution (one-sided), 
      all other tests are based on a mixture of F-distributions.

The conclusions are the same: Type B \(\bar{F}\) = 3.04, p = .166, Type A \(\bar{F}\) = 64.50, p < .001. In example 5, robust estimation did make a difference.

Bootstrapped p-values

The p-values of Type A and B are based on F-bar distributions, which assume normally distributed errors. A model-based bootstrap does not need that assumption:

out.boot <- iht(fit, constraints = H1, type = "A",
                boot = "model.based", R = 2000, seed = 2026)
out.boot

Restriktor: restricted hypothesis tests: 
( Number of successful bootstrap draws: 2000 )

Multiple R-squared reduced from 0.224 to 0.215 

Type A test: H0: all restrictions are equalities (==) 
         vs. HA: at least one inequality restriction is strictly true (>)

 F-test statistic           p-value 
          73.6349           <0.0001 

Constraint matrix:
   (Intercept) gender age TBSA guilt anger    op rhs active
1:           0      0   0    1     0     0    >=   0    yes
2:           0      0   0    0     1     0    >=   0     no
3:           0      0   0    0     0     1    >=   0     no

restricted estimate under H0:
(Intercept)       gender          age         TBSA        guilt        anger  
  32.778267     0.745323     0.095608     0.000000     0.000000     0.000000  

restricted estimate under HA:
(Intercept)       gender          age         TBSA        guilt        anger  
   18.13551      1.42045      0.14022      0.00000      3.52246      3.42547  

With R = 2000 draws, the p-value is accurate enough for this illustration. For a publication, use more draws (the default is 9999). With parallel = "multicore" and ncpus, the bootstrap runs on several cores.