rhteutils: rhte utility functions

Description Usage Arguments Details Author(s) Examples

Description

The rhte package contains some useful utility functions to extract relevant information from objects of the class "svystat.rob".

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
robweights(object)
## S3 method for class 'svystat.rob'
print(x, ...)
## S3 method for class 'svystat.rob'
summary(object, ...)
## S3 method for class 'svystat.rob'
coef(object, ...)
## S3 method for class 'svystat.rob'
vcov(object, ...)
## S3 method for class 'svystat.rob'
residuals(object, ...)

Arguments

x

(only used by the print method)

object

(only used by the summary, coef, and vcov method)

...

additional specifications

Details

Author(s)

Beat Hulliger and Tobias Schoch

Examples

 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)

rhte documentation built on May 2, 2019, 6:24 p.m.