Description Usage Arguments Details Author(s) Examples
The rhte
package contains some useful utility functions to extract relevant information from objects of the class "svystat.rob"
.
1 2 3 4 5 6 7 8 9 10 11 |
x |
(only used by the |
object |
(only used by the |
... |
additional specifications |
summary
is a method to summarize the object
coef
is a method to extract the estimates (coefficients) from a svystat.rob
object
vcov
is a method to extract the variance from a svystat.rob
object
print
is a print method
residuals
extracts the residuals from a svystat.rob
object
robweights
extracts the robustness weights from an M-estimate
Beat Hulliger and Tobias Schoch
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | ## load "api" data set from "survey" package (a description of the data
## set can be found there)
data(api)
## define "survey.design" for stratified sampling
dstrat <- svydesign(id=~1,strata=~stype, weights=~pw, data=apistrat,
fpc=~fpc)
## compute a robust Horvitz-Thompson estimate for the mean of the
## variable api00 (Academic Performance Index in 2000)
rht1 <- msvymean(~api00, dstrat, type="rht", k=4)
# get a summary of the estimation
summary(rht1)
## robust Horvitz-Thompson estimates for a domain of the variable. Here
## we are interessted in the robust mean for api00 in case of
## (sch.wide == "Yes"). That is the average of the academic performance
## in 2000 only for the schools that met the school-wide growth target.
msvymean(~api00, subset(dstrat, sch.wide == "Yes"), k=4, type="rht")
## to extract the estimate from the object
coef(rht1)
## to extract the variance from the object
vcov(rht1)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.