svyscoretest | R Documentation |
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.
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, ...)
model |
A model of a class having a |
drop.terms |
Model formula giving terms to remove from |
add.terms |
Model formula giving terms to add to |
method |
The type of score test to use. For a single parameter they are
equivalent. To report tests for each column separately use |
ddf |
denominator degrees of freedom for an F or linear combination
of F distributions. Use |
lrt.approximation |
For the working score, the method for computing/approximating the null
distribution: see |
fullrank |
If |
... |
for future expansion |
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.
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"
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.
regTermTest
, anova.svyglm
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")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.