create_output: Create outputs from an audit_measure object

Description Usage Arguments

View source: R/audit_measure.R

Description

create_output is a method to produce a set of instructions to pass to dplyr::summarise, which is then applied over a cohort to produce our cohort results. The instructions are passed as rlang::exprs, which can be appended to the summary step using the rlang::!!! operator. Output columns have a consistent naming convention.

Usage

1
2
3
4
5
6
7
8
9
create_output(x, numerator = NULL, output_type)

## S3 method for class 'audit_measure_continuous'
create_output(x, numerator = NULL,
  output_type)

## S3 method for class 'audit_measure_discrete'
create_output(x, numerator = NULL,
  output_type)

Arguments

x

An audit_measure object.

numerator

If the measure has more than one numerator and only one of the numerators is required, this should be set to the name of the numerator. If only one numerator is specified in the measure, or all numerators are to be used, then this should be omitted (or set to NULL).

output_type

Determines which sort of aggregated results are being requested from the data:

  • median Only applicable to audit_measure_continuous types. It calculates the median and returns it in a column named with the audit_measure's stem name followed by Q2, e.g. myMeasureQ2. Multiple numerators are not supported by the median output type and will generate an error. This may be fixed if there is a need for it in future. Exclusion criteria are also not currently handled - this is likely to be addressed in future.

  • quartiles This option is similar to median but in addition to generating Q2, it also creates the lower and upper quartiles, suffixed by Q1 and Q3.


md0u80c9/SSNAPStats documentation built on Feb. 11, 2020, 11:43 a.m.