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:
state
state, [character]
.
county
county, [character]
.
landarea
land area, 1990 (square miles),
[double]
.
totpop
population total, 1992, [double]
.
unemp
number of unemployed persons, 1991,
[double]
.
farmpop
farm population, 1990, [double]
.
numfarm
number of farms, 1987, [double]
.
farmacre
acreage in farms, 1987, [double]
.
weights
sampling weight, [double]
.
fpc
finite 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.