svyPVlevel(by, svydat, pvs, CATDEF,levlab=NA,right=TRUE, colN=FALSE)
svydesign
as well as svrepdesign
) which was generated by the survey
package. To figure out how to create a survey design object, please read the help files for the survey
package.
svydat
.
cut
function.
paste0("level", NUMBEROFLEVELS)
cut
function. If TRUE, which is the default, the intervals built by this function are closed on the right.by
. The kth group column contains the different levels defined by the CATDEF
vector.All variables, including the subsetting ones defined with by
, must be part of the survey design object.
Missing values are deleted listwise.
Note that '.' is not allowed as part of the level string of a by
variable. For example c("1.thing","2.thing") is not allowed and will cause a error message.
Saerndal, C.-E. & Swensson, B. & Wretman, J. (1992). Model Assisted Survey Sampling. New York: Springer.
Chaudhuri, A. & Stenger, H. (2005). Survey Sampling. Theory and Methods. Boka Raton, FL: Chapman & Hall/CRC.
svyPVbenchmark
data(svy_example1)
erg_l <- svyPVlevel(by = ~ sex, svydat=svy.exrep,
pvs=c("plaus1","plaus2","plaus3"), CATDEF=c(0,310,322,400))
erg_l
Run the code above in your browser using DataLab