| workplace | R Documentation | 
The workplace data are from Fuller (2009, pp. 366–367).
data(workplace)A data.frame with a sample of 142 workplaces on the following
variables
IDidentifier variable [integer].
weightsampling weight [double].
employmentemployment total [double].
payrollpayroll total (1000 dollars)[double].
stratstratum identifier[integer].
fpcfinite population correction [integer].
The workplace data represent a sample of workplaces in the
retail sector in a Canadian province. The data are not those
collected by Statistics Canada, but have been generated by Fuller
(2009, Example 3.1.1) to display similar characteristics to the
original 1999 Canadian Workplace and Employee Survey (WES).
The WES target population is defined as all workplaces operating in Canada with paid employees. The sampling frame is stratified by industry, geographic region, and size (size is defined using estimated employment). A sample of workplaces has been drawn independently in each stratum using simple random sample without replacement (the stratum-specific sample sizes are determined by Neyman allocation). Several strata containing very large workplaces were sampled exhaustively; see Patak et al (1998). The original sampling weights were adjusted for nonresponse.
The original weights of WES were about 2200 for the stratum of small workplaces, about 750 for medium-sized, and about 35 for large workspaces.
The data workplace is from Table 6.3 in Fuller (2009, pp. 366–367).
Fuller, W. A. (2009). Sampling Statistics, Hoboken (NJ): John Wiley and Sons. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1002/9780470523551")}
Patak, Z., Hidiroglou, M. and Lavallée, P. (1998). The methodology of the Workplace and Employee Survey. Proceedings of the Survey Research Methods Section, American Statistical Association, 83–91.
head(workplace)
library("survey")
# Survey design for stratified simple random sampling without replacement
dn <- if (packageVersion("survey") >= "4.2") {
        # survey design with pre-calibrated weights
        svydesign(ids = ~ID, strata = ~strat, fpc = ~fpc, weights = ~weight,
                  data = workplace, calibrate.formula = ~-1 + strat)
    } else {
        # legacy mode
        svydesign(ids = ~ID, strata = ~strat, fpc = ~fpc, weights = ~weight,
                  data = workplace)
    }
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.