As we did in previous chapters, we used Wald tests for p-values in this Chapter. However, likelihood ratio (LR) tests may perform better (Thomas and Rao 1987). 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 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 LR test to test the overall significance of race/ethnicity in the weighted adjusted linear regression model for fasting glucose.
# Model fit previously .1 <- svyglm(LBDGLUSI ~ BMXWAIST + smoker + RIDAGEYR + fit.ex8+ race_eth + income, RIAGENDR family=gaussian(), design=design.FST.nomiss)
# 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