View source: R/epi_stats_prop_outcome.R
epi_stats_prop_outcome | R Documentation |
It can be used to estimate the case fatality rate.
epi_stats_prop_outcome(
df,
outcome_var_window,
pop_at_risk_var,
analysis_window,
round_dig = 4
)
df |
A data frame containing the data. |
outcome_var_window |
A string representing the column name of the outcome variable at the analysis window. Expects an integer where 1 = event, 0 = no event. |
pop_at_risk_var |
A string representing the column name of the population at risk variable. This is matched against the analysis window to obtain a subset. |
analysis_window |
A value from the variable passed as |
round_dig |
An integer representing the number of decimal places to round the result to. Default is 4. |
The proportion of individuals who suffered the event at the given point, printed and returned as a numeric value.
## Not run:
df <- data.frame(
d_T0_outcome = c(1, 0, 1, 0, 1),
d_time_cuts_prev = c('T0', 'T1', 'T0', 'T1', 'T0')
)
outcome_var_window <- 'd_T0_outcome'
pop_at_risk_var <- 'd_time_cuts_prev'
analysis_window <- 'T0'
epi_stats_prop_outcome(df, outcome_var_window, pop_at_risk_var, analysis_window)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.