reweight_data: This function allows for the reweighting of any dataset with...

Description Usage Arguments Value

View source: R/reweight_samp.R

Description

This function allows for the reweighting of any dataset with information on age (in 10 year increments from 15 to 65), race (black, hispanic, or other), and region of Washington to match the ACS based joint age / race distribution and proportion of MSM in each region.

Usage

1
2
3
4
5
6
7
reweight_data(
  obs_data,
  age_c_name = "age.grp",
  race_c_name = "race",
  reg_c_name = "region",
  ego_id_name = "ego.id"
)

Arguments

obs_data

The observed data for which weights are wanted.

age_c_name

The name of the age column in the data frame.

race_c_name

The name of the race column in the data frame.

reg_c_name

The name of the region column in the data frame.

ego_id_name

The name of the column with unique identifiers for each ego.

Value

A vector of weights such that the observations with these weights match the Washington Age / Race distribution and regional MSM distribution.


Shmelder/popdata documentation built on Aug. 4, 2020, 12:04 a.m.