allocate: Allocate people in the joint PHA/Medicaid/Medicare data

View source: R/allocate.R

allocateR Documentation

Allocate people in the joint PHA/Medicaid/Medicare data

Description

allocate summarizes population data in the joint PHA/Medicaid/Medicare data.

Usage

allocate(
  df,
  starttime = NULL,
  endtime = NULL,
  agency = NULL,
  enroll = NULL,
  unit = NULL,
  from_date = NULL,
  to_date = NULL,
  ...
)

Arguments

df

A data frame

starttime

Start date for the period of interest. Required. Use YYYY-MM-DD.

endtime

End date for the period of interest. Required. Use YYYY-MM-DD.

agency

A named variable that specifies the agency a person is in for that period of time (must be KCHA, SHA, or NA). Used to allocate individuals who moved between multiple agencies/enrollment types in the period. Required, default is pha_agency.

enroll

A named variable that specifies the type of enrollment a person is in for that period of time (field should contain the following codes: "h" = housing only, "md" = Medicaid only, "me" = Medicare only , "hmd" = housing and Medicaid, "hme" = housing and Medicare, "mm" = Medicaid and Medicare (dual eligible), "a" = all three. Used to allocate individuals who moved between multiple agencies/enrollment types in the period. Default is enroll_type.

unit

A named variable that determines the unit of analysis. Default is id_apde (individuals) but pid should be used with unmatched PHA data. Other options include hhold_id_new for households.

from_date

A string that specifies the variable name for the time an individual or household starts at that address/program. Default is set for the linked PHA/Medicaid data (from_date) but if that is not present then the next default is startdate.

to_date

A string that specifies the variable name for the time an individual or household ends participation at that address/program. Default is set for the linked PHA/Medicaid data (to_date) but if that is not present then the next default is enddate.

...

A set of variables to allocate over (do not include agency or enroll vars).

Details

This function allocates people within a specified time range to a set of housing and Medicaid/Medicare groups based on a hierarchy of rules. Useful for examining demographic distributions across PHA groups or creating population denominators #' for chronic conditions. The function works for PHA data regardless of whether or not it has also been matched to Medicaid/Medicare data.

Examples

## Not run: 
allocate(mcaid_mcare_pha_elig_timevar, starttime = "2015-01-01", 
endtime = "2015-12-31", enroll = enroll_type, unit = id_apde, 
from_date = from_date, o_date = to_date, pha_agency, pha_subsidy)

## End(Not run)


PHSKC-APDE/Housing documentation built on Feb. 6, 2024, 3:27 a.m.