Skip to contents

Summarise the observation period table getting some overall statistics in a summarised_result object.

Usage

summariseObservationPeriod(
  observationPeriod,
  estimates = c("mean", "sd", "min", "q05", "q25", "median", "q75", "q95", "max",
    "density"),
  ageGroup = NULL,
  sex = FALSE
)

Arguments

observationPeriod

observation_period omop table.

estimates

Estimates to summarise the variables of interest ( records per person, duration in days and days to next observation period).

ageGroup

A list of age groups to stratify results by.

sex

Boolean variable. Whether to stratify by sex (TRUE) or not (FALSE).

Value

A summarised_result object with the summarised data.

Examples

# \donttest{
library(dplyr, warn.conflicts = FALSE)

cdm <- mockOmopSketch(numberIndividuals = 100)

result <- summariseObservationPeriod(cdm$observation_period)

result |>
  glimpse()
#> Rows: 3,120
#> Columns: 13
#> $ result_id        <int> 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,…
#> $ cdm_name         <chr> "mockOmopSketch", "mockOmopSketch", "mockOmopSketch",…
#> $ group_name       <chr> "overall", "overall", "overall", "overall", "overall"…
#> $ group_level      <chr> "overall", "overall", "overall", "overall", "overall"…
#> $ strata_name      <chr> "overall", "overall", "overall", "overall", "overall"…
#> $ strata_level     <chr> "overall", "overall", "overall", "overall", "overall"…
#> $ variable_name    <chr> "number records", "number subjects", "records per per…
#> $ variable_level   <chr> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, N…
#> $ estimate_name    <chr> "count", "count", "mean", "sd", "min", "q05", "q25", …
#> $ estimate_type    <chr> "integer", "integer", "numeric", "numeric", "integer"…
#> $ estimate_value   <chr> "100", "100", "1", "0", "1", "1", "1", "1", "1", "1",…
#> $ additional_name  <chr> "overall", "overall", "overall", "overall", "overall"…
#> $ additional_level <chr> "overall", "overall", "overall", "overall", "overall"…

PatientProfiles::mockDisconnect(cdm)
# }