weight_to: weight_to

Description Usage Arguments Value Author(s) Examples

Description

Creates proportions (with names) of the variables you want to weight to.

Usage

1

Arguments

vector

Numeric vector of the proportions. Probably something like c(33,33,34).

names

Character vector of names. Probably something like c("Dem","Rep","Ind")

Value

Numeric vector of proportions with names associated with it.

Author(s)

Loren Collingwood <loren.collingwood@ucr.edu>

Examples

1
2
3
4
5
6
7
8
9
#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_age
weight_props_gender <- weight_to(c(49,51), c("Male","Female"))
weight_props_gender
weight_props_party <- weight_to(c(33.8,28.1,38.1), c("Dem","Rep","Ind"))
weight_props_party
weight_props_region <- weight_to(c(53.5,20.6,25.8), c("Reg1-PS","Reg2-EW","Reg3-O"))
weight_props_region

lorenc5/Rweights3 documentation built on May 29, 2019, 11:05 p.m.