time_cohort_outcomes: Time cohort outcomes

Description Usage Arguments Value Examples

View source: R/time_cohort_outcomes.R

Description

Time cohort outcomes

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
time_cohort_outcomes(
  df,
  start_var,
  time_months,
  status_var,
  id_var,
  date_var,
  reporting_date,
  convert_to_df = FALSE
)

Arguments

df

data frame of treatment status over time

start_var

character name of start treament date

time_months

numeric vector defining which time cohorts to include

status_var

character name of HIV status variable in data frame

id_var

character name of ID variable in data frame

date_var

character name of status change date variable in data frame

reporting_date

date of reporting time - typically the first day of the reporting month

convert_to_df

flag defining whether to reduce the final output from a list to a wide data frame - defaults to FALSE

Value

data frame where each row represents one patient and HIV treatment status at specified time points are represented by variables

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
## Not run: 
status_calculator(df = x,
                  time_months = c(6, 12, 24),
                  status_var = "hiv_status",
                  id_var = "id",
                  start_var = "starttre"
                  date_var = "date", 
                  reporting_date = lubridate::dmy("01/09/2010"),
                  convert_to_df = TRUE)

## End(Not run)

JayAchar/hisreportr documentation built on March 18, 2020, 5:57 a.m.