Is ranktermtest equal to the F-test of overall significance?

If I choose all the independent variables of a model, is ranktermtest function of survey package equal to the F-test of overall significance? It seems that the hypothesis of the F-test of overall significance is all of the coefficients equal zero.

I don't see a survey::ranktermtest and it's not listed in the manual. Do you mean survey::regTermTest?

Sorry I made a mistake. This is what I mean, survey::regTermTest .

From help(regTermTest)

Details
The Wald test uses a chisquared or F distribution. The two working-model tests come from the (misspecified) working model where the observations are independent and the weights are frequency weights. For categorical data, this is just the model fitted to the estimated population crosstabulation. The Rao-Scott LRT statistic is the likelihood ratio statistic in this model. The working Wald test statistic is the Wald statistic in this model. The working-model tests do not have a chi-squared sampling distribution: we use a linear combination of chi-squared or F distributions as in pchisqsum. I believe the working Wald test is what SUDAAN refers to as a "Satterthwaite adjusted Wald test".

So, the answer to the question depends on which method is used

library(survey)
#> Loading required package: grid
#> Loading required package: Matrix
#> Loading required package: survival
#> 
#> Attaching package: 'survey'
#> The following object is masked from 'package:graphics':
#> 
#>     dotchart
data(esoph)
colnames(esoph)
#> [1] "agegp"     "alcgp"     "tobgp"     "ncases"    "ncontrols"
model1 <- glm(cbind(ncases, ncontrols) ~ agegp + tobgp * 
                alcgp, data = esoph, family = binomial())
anova(model1)
#> Analysis of Deviance Table
#> 
#> Model: binomial, link: logit
#> 
#> Response: cbind(ncases, ncontrols)
#> 
#> Terms added sequentially (first to last)
#> 
#> 
#>             Df Deviance Resid. Df Resid. Dev
#> NULL                           87     367.95
#> agegp        5  121.045        82     246.91
#> tobgp        3   36.639        79     210.27
#> alcgp        3  127.933        76      82.34
#> tobgp:alcgp  9    5.451        67      76.89

regTermTest(model1,"tobgp") # default Wald method
#> Wald test for tobgp
#>  in glm(formula = cbind(ncases, ncontrols) ~ agegp + tobgp * alcgp, 
#>     family = binomial(), data = esoph)
#> F =  6.080611  on  3  and  67  df: p= 0.0010073
regTermTest(model1,"tobgp", method = "WorkingWald")
#> Working (Rao-Scott+F)  for tobgp
#>  in glm(formula = cbind(ncases, ncontrols) ~ agegp + tobgp * alcgp, 
#>     family = binomial(), data = esoph)
#> Working Wald statistic =  18.24183 p= 0.0010254 
#> (scale factors:  1 1 1 );  denominator df= 67
regTermTest(model1,"tobgp", method = "LRT")
#> Working (Rao-Scott+F) LRT for tobgp
#>  in glm(formula = cbind(ncases, ncontrols) ~ agegp + tobgp * alcgp, 
#>     family = binomial(), data = esoph)
#> Working 2logLR =  2.842171e-14 p= 1 
#> (scale factors:  1 1 1 );  denominator df= 67

Created on 2023-01-06 with reprex v2.0.2

Thanks for your explanation. Is the last method mean the F-test?

Not quite. It's the linear combination of chi-squareds multiplied by denominator degrees of freedem and then divided by an independent chi-squared with denominator degrees of freedom. This paper can be expected to have details.

Thanks! I will check this paper!

1 Like