Description Usage Arguments Value References Examples
Takes a dataset, sorts it by one or more variables, and draws samples at regular intervals. A fractional skip interval is used so that each record still has an equal probability of selection when the number of records in the frame is not evenly divisible by the sample size.
1 |
.data |
A dataset, in data.frame or tibble format. |
size |
The size of the desired sample. |
stratvars |
Names of variables by which the sampling frame will be sorted |
return_indices |
Return a vector containing the indices of the selected records. Defaults to |
seed |
Optional. Ensures that the same sample will be created if the code is rerun. |
Either a vector of indices or a data.frame/tibble.
Buskirk, T.D. (2008) Sampling interval. In P.J. Lavrakas, Encyclopedia of survey research methods. Thousand Oaks, CA: Sage Publications.
1 2 3 | dec13_sample_indices <- syssamp(dec13_excerpt, size = 10, stratvars = c("sex", "recage"))
dec13_sample <- syssamp(dec13_excerpt, size = 10, stratvars = c("sex", "recage"),
return_indices = FALSE)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.