## 8.8 Likelihood ratio test vs. Wald test

As with previous chapters, Wald tests for p-values were used in this chapter. However, likelihood ratio (LR) tests are, in general, more powerful. True LR tests are not possible with `svyglm()`

objects since they were not fit using maximum likelihood (Lumley 2010). However, the function `regTermTest()`

can be used to carry out a “working” LR test for weighted linear, logistic, or Cox regression models (the Rao-Scott LR test) (Rao and Scott 1984; Lumley and Scott 2013, 2014) to compare any two nested models, similar to `anova()`

which we used in previous chapters.

`regTermTest()`

can therefore obtain an overall Type 3 Wald or working LR test for a categorical predictor with more than two levels. To get a test for a single level of a categorical predictor, first create indicator variables for the levels of that predictor as described in Section 6.18.

**Example 8.1 (continued):** Use a working LR test to test the overall significance of race/ethnicity in the weighted adjusted linear regression model for fasting glucose. For comparison, also compute the Wald test.

```
# Model fit previously
fit.ex8.1 <- svyglm(LBDGLUSI ~ BMXWAIST + smoker + RIDAGEYR +
RIAGENDR + race_eth + income,
family=gaussian(), design=design.FST.nomiss)
```

```
# Working LR test for race_eth
regTermTest(fit.ex8.1,
test.terms = ~ race_eth,
df = degf(fit.ex8.1$survey.design),
method = "LRT")
```

```
## Working (Rao-Scott+F) LRT for race_eth
## in svyglm(formula = LBDGLUSI ~ BMXWAIST + smoker + RIDAGEYR + RIAGENDR +
## race_eth + income, design = design.FST.nomiss, family = gaussian())
## Working 2logLR = 11.29 p= 0.042
## (scale factors: 1.8 0.93 0.31 ); denominator df= 15
```

```
# Wald test for race_eth
regTermTest(fit.ex8.1,
test.terms = ~ race_eth,
df = degf(fit.ex8.1$survey.design),
method = "Wald")
```

```
## Wald test for race_eth
## in svyglm(formula = LBDGLUSI ~ BMXWAIST + smoker + RIDAGEYR + RIAGENDR +
## race_eth + income, design = design.FST.nomiss, family = gaussian())
## F = 3.003 on 3 and 15 df: p= 0.064
```

**Conclusion:** Based on the likelihood-ratio test, race/ethnicity is significantly associated with fasting glucose, after adjusting for the other variables in the model (p = .042). As previously mentioned, LRTs are generally more powerful than Wald tests, which means lower p-values. In this example, that is the case, with the Wald test p-value being .064.

### References

*Complex Surveys: A Guide to Analysis Using r: A Guide to Analysis Using r*. John Wiley; Sons.

*Statistics in Medicine*32 (1): 110–23. https://doi.org/10.1002/sim.5492.

*Australian & New Zealand Journal of Statistics*56 (1): 1–14. https://doi.org/10.1111/anzs.12065.

*The Annals of Statistics*12 (1): 46–60. https://www.jstor.org/stable/2241033.