| counties | R Documentation |
Data from a simple random sample (without replacement) of 100 of the 3141 counties in the United Stated (U.S. Bureau of the Census, 1994).
data(counties)
A data.frame with 100 observations on the following variables:
statestate, [character].
countycounty, [character].
landarealand area, 1990 (square miles),
[double].
totpoppopulation total, 1992, [double].
unempnumber of unemployed persons, 1991,
[double].
farmpopfarm population, 1990, [double].
numfarmnumber of farms, 1987, [double].
farmacreacreage in farms, 1987, [double].
weightssampling weight, [double].
fpcfinite population corretion, [double].
The data (and 10 additional variables) are published in Lohr (1999, Appendix C).
Lohr, S. L. (1999). Sampling: Design and Analysis, Pacific Grove (CA): Duxbury Press.
head(counties)
library(survey)
# Survey design for simple random sampling without replacement
dn <- if (packageVersion("survey") >= "4.2") {
# survey design with pre-calibrated weights
svydesign(ids = ~1, fpc = ~fpc, weights = ~weights, data = counties,
calibrate.formula = ~1)
} else {
# legacy mode
svydesign(ids = ~1, fpc = ~fpc, weights = ~weights, data = counties)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.