Description Usage Arguments Value Examples
Simulate the true response to a continuous numerical response question in a given population with specified characteristics for sex, race/ethnicity, age, and geography
1 2 | simulate_response_age_continuous(geovector, lambda_geography, lambda_sex,
lambda_raceethnicity, lambda_age)
|
geovector |
A vector of geographies specified as a two letter
abbreviation or a 5-digit FIPS code. Each geography must be the entire U.S.
( |
lambda_geography |
Numeric vector specifying lambda (Poisson
distribution) for the survey respondents by geography in the same bins as
|
lambda_sex |
Numeric vector specifying lambda (Poisson distribution)
for the survey respondents by sex in the order male, then female, for
example, |
lambda_raceethnicity |
Numeric vector specifying lambda for the survey
respondents by race/ethnicity in the order white alone, Hispanic or Latino,
black alone, Asian alone, and other, for example,
|
lambda_age |
Numeric vector specifying lambda for survey respondents by
age in the following bins: under 18 years, 18 to 24 years, 25 to 44 years,
45 to 64 years, 65 years and over, for example, |
A data frame with 3 columns (value
, answer
, and
result
) that tabulates the true response to the continuous, numerical
survey question in the given population.
1 2 3 4 5 6 7 8 9 10 11 12 | geovector <- c("WI", "WV")
lambda_geography <- c(50, 10)
# lambda_sex specifies the response weights of men/women
# in this example, women have a higher mean response than men
lambda_sex <- c(25, 75)
lambda_raceethnicity <- c(90, 10, 50, 50, 50)
lambda_age <- c(50, 60, 70, 75, 80)
opinionDF <- simulate_response_age_continuous(geovector,
lambda_geography,
lambda_sex,
lambda_raceethnicity,
lambda_age)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.