aggregate | R Documentation |
Aggregation of indicators as provided for each unit (hospital) at organization levels above hospital: health trust, regional health trust and national.
agg(df, org, ind, ind_noagg = character(), orgnr_name_map)
agg_dg(aggs, ind)
agg_from_level(df, org, ind, conf, from_level)
agg_residual(aggs, conf)
agg_udef(diff, conf)
df |
Data frame |
org |
Data frame holding the flat org table with all levels needed. May
be obtained by |
ind |
Data frame holding the indicator db table providing all data on each indicator |
ind_noagg |
Character vector identifying indicator (ids) that are not to
be aggregated (used as is). Default is |
orgnr_name_map |
Data frame with global mapping of organization id and name. Applied on data to be used as is (no aggregation). |
aggs |
Data frame of (pre) aggregated data |
conf |
List of configuration |
from_level |
Integer specifying from what level to aggregate from |
diff |
Data frame with diff data |
All functions are adapted from qmongr/qmongrdata. However, the nomenclature of function arguments are changed somewhat. Main source of underlying data is the qmongr database and where tables are used in these function their names are kept as is (org and ind). Other data frames passed into or between function is denoted df. The aggregate consists of the following variables:
The year of the current record
Indicator ID
Organization ID
How orgnr is to be understood, e.g. caregiver, or patient residency
Number of observations of the current record
Summarised indicator value, for instance mean or median
Code providing level of aggregation such as 'hospital', 'hf' (health trust), 'rhf' (regional health trust) and 'national'
Name of the organization unit
Data frame in raw, grouped or aggregated form
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.