Description Usage Arguments Value Author(s) Examples
Creates a weight amount ratio that will be applied to each respondent.
1 | weight_amount(weight_props, survey_props)
|
weight_props |
Numeric vector. Probably object created from weight_to function. |
survey_props |
Numeric vector. Probably object created from gen_survey_props function. |
Numeric vector of “weight to” proportions.
Loren Collingwood <loren.collingwood@ucr.edu>
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | #NOT RUN: READ IN DATA
data (wapoll)
#NOT RUN: CREATE WEIGHT TO PROPORTIONS
weight_props_age <- weight_to(c(26.0,39.3,34.7), c("18-40","41-65","66+"))
weight_props_gender <- weight_to(c(49,51), c("Male","Female"))
#NOT RUN: CREATE PROPORTIONS FROM DATA
age_current <- gen_survey_props(wapoll$age3) #1=18-40,2=41-65,3=66+; age3
gender_current <- gen_survey_props(wapoll$gender) #0=Male, 1=Female
#NOT RUN: CREATE WEIGHT TO AMOUNT
age_weight_to <- weight_amount(weight_props_age,age_current)
age_weight_to
gender_weight_to <- weight_amount(weight_props_gender,gender_current)
gender_weight_to
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.