calculate_median_los: Calculate median length of stay for a cohort of CMAM...

View source: R/length_of_stay.R

calculate_median_losR Documentation

Calculate median length of stay for a cohort of CMAM discharges

Description

Calculate median length of stay for a cohort of CMAM discharges

Usage

calculate_median_los(admission_date, discharge_date, group = NULL)

Arguments

admission_date

Date of admission in YYYY-MM-DD format. If child is a kwashiorkor case, date of lowest weight (when oedema has subsided). Can be a single date value or a vector of date values.

discharge_date

Date of discharge in YYYY-MM-DD format. Can be a single date value or a vector of date values.

group

A character value/s with the same length as admission_date and discharge_data to use as grouping variable within which median length-of-stay is to be calculated. Default is NULL for no grouping.

Value

A numeric value for median length-of-stay in days. If group is not NULL, a vector of numeric values for median length-of-stay in days with length equal to the number of groups.

Author(s)

Ernest Guevarra

Examples

calculate_median_los(
  otp_beneficiaries$admDate,
  otp_beneficiaries$disDate,
  group = otp_beneficiaries$locality
)


rapidsurveys/squeacr documentation built on April 26, 2024, 1:08 a.m.