Description Usage Arguments Details Value Author(s) References Examples
Calculates the degrees of freedom for a statistic (or of a contrast between two statistics) based on the jackknife and imputation variance estimates.
1 2  DoFCorrection(varEstA, varEstB = varEstA, varA, varB = varA,
method = c("WS", "JR"))

varEstA 
the varEstInput object returned from certain functions, such as

varEstB 
similar to the 
varA 
a character that names the statistic in the 
varB 
a character that names the statistic in the 
method 
a character that is either 
This calculation happens under the notion that statistics have little variance within strata, and some strata will contribute fewer than a full degree of freedom.
Note that these functions are not vectorized, so varA
and
varB
must contain exactly one variable name.
The method used to compute the degrees of freedom is in the vignette titled Statistics section “Estimation of Degrees of Freedom.”
numeric; the estimated degrees of freedom
Paul Bailey
Johnson, E. G., & Rust, K. F. (1992). Population inferences and variance estimation for NAEP data. Journal of Educational Statistics, 17, 175–190.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26  sdf < readNAEP(system.file("extdata/data", "M36NT2PM.dat", package="NAEPprimer"))
lm1 < lm.sdf(composite ~ dsex + b017451, sdf, returnVarEstInputs=TRUE)
summary(lm1)
# this output agrees with summary of lm1 coefficient for dsex
DoFCorrection(lm1$varEstInputs,
varA="dsexFemale",
method="JR")
# second example, a covariance term requires more work
# first, estimate the covariance between two regression coefficients
# note that the variable names are parallel to what they are called in lm1 output
covFEveryDay < varEstToCov(lm1$varEstInputs,
varA="dsexFemale",
varB="b017451Every day",
jkSumMultiplier=EdSurvey:::getAttributes(sdf, "jkSumMultiplier"))
# second, find the difference and the SE of the difference
se < lm1$coefmat["dsexFemale","se"] + lm1$coefmat["b017451Every day","se"] +
2*covFEveryDay
# third, calculate the tstatistic
tv < (coef(lm1)["dsexFemale"]  coef(lm1)["b017451Every day"])/se
# fourth, calculate the pvalue, which requires the estimated degrees of freedom
dofFEveryDay < DoFCorrection(lm1$varEstInputs,
varA="dsexFemale",
varB="b017451Every day",
method="JR")
# finally, the pvalue
2*(1pt(abs(tv), df=dofFEveryDay))

Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.