svyscoretest: Score tests in survey regression models

View source: R/score.R

svyscoretestR Documentation

Score tests in survey regression models

Description

Performs two versions of the efficient score test. These are the same for a single parameter. In the working score test, different parameters are weighted according to the inverse of the estimated population Fisher information. In the pseudoscore test, parameters are weighted according to the inverse of their estimated covariance matrix.

Usage

svyscoretest(model, drop.terms=NULL, add.terms=NULL,
method=c("working","pseudoscore","individual"),ddf=NULL,
lrt.approximation = "satterthwaite", ...)
## S3 method for class 'svyglm'
svyscoretest(model, drop.terms=NULL, add.terms=NULL,
method=c("working","pseudoscore","individual"), ddf=NULL,
lrt.approximation = "satterthwaite",fullrank=TRUE, ...)

Arguments

model

A model of a class having a svyscoretest method (currently just svyglm)

drop.terms

Model formula giving terms to remove from model

add.terms

Model formula giving terms to add to model

method

The type of score test to use. For a single parameter they are equivalent. To report tests for each column separately use individual

ddf

denominator degrees of freedom for an F or linear combination of F distributions. Use Inf to get chi-squared distributions. NULL asks for the model residual degrees of freedom, which is conservative.

lrt.approximation

For the working score, the method for computing/approximating the null distribution: see pchisqsum

fullrank

If FALSE and method="individual", keep even linearly dependent columns of the efficient score

...

for future expansion

Details

The working score test will be asymptotically equivalent to the Rao-Scott likelihood ratio test computed by regTermTest and anova.svyglm. The paper by Rao, Scott and Skinner calls this a "naive" score test. The null distribution is a linear combination of chi-squared (or F) variables.

The pseudoscore test will be asymptotically equivalent to the Wald test computed by regTermTest; it has a chi-squared (or F) null distribution.

If ddf is negative or zero, which can happen with large numbers of predictors and small numbers of PSUs, it will be changed to 1 with a warning.

Value

For "pseudoscore" and "working" score methods, a named vector with the test statistic, degrees of freedom, and p-value. For "individual" an object of class "svystat"

References

JNK Rao, AJ Scott, and C Rao, J., Scott, A., & Skinner, C. (1998). QUASI-SCORE TESTS WITH SURVEY DATA. Statistica Sinica, 8(4), 1059-1070.

See Also

regTermTest, anova.svyglm

Examples

data(myco)
dmyco<-svydesign(id=~1, strata=~interaction(Age,leprosy),weights=~wt,data=myco)

m_full<-svyglm(leprosy~I((Age+7.5)^-2)+Scar, family=quasibinomial, design=dmyco)
svyscoretest(m_full, ~Scar)

svyscoretest(m_full,add.terms= ~I((Age+7.5)^-2):Scar)
svyscoretest(m_full,add.terms= ~factor(Age), method="pseudo")
svyscoretest(m_full,add.terms= ~factor(Age),method="individual",fullrank=FALSE)

svyscoretest(m_full,add.terms= ~factor(Age),method="individual")


survey documentation built on May 29, 2024, 12:05 p.m.