R/TimeSeries.R
runCohortTimeSeriesDiagnostics.Rd
This function first generates a calendar period table, that has
calendar intervals between the timeSeriesMinDate
and timeSeriesMaxDate
.
Calendar Month, Quarter and year are supported.
For each of the calendar interval, time series data are computed. The returned
object is a R dataframe that will need to be converted to a time series object
to perform time series analysis.
Data Source time series: computes time series at the data source level i.e. observation period table. This output is NOT limited to individuals in the cohort table but is for ALL people in the datasource (i.e. present in observation period table)
runCohortTimeSeriesDiagnostics(
connectionDetails = NULL,
connection = NULL,
tempEmulationSchema = NULL,
cdmDatabaseSchema,
cohortDatabaseSchema = cdmDatabaseSchema,
cohortTable = "cohort",
runCohortTimeSeries = TRUE,
runDataSourceTimeSeries = FALSE,
timeSeriesMinDate = as.Date("1980-01-01"),
timeSeriesMaxDate = as.Date(Sys.Date()),
stratifyByGender = TRUE,
stratifyByAgeGroup = TRUE,
cohortIds = NULL
)
An object of type connectionDetails
as created using the
createConnectionDetails
function in the
DatabaseConnector package. Can be left NULL if connection
is
provided.
An object of type connection
as created using the
connect
function in the
DatabaseConnector package. Can be left NULL if connectionDetails
is provided, in which case a new connection will be opened at the start
of the function, and closed when the function finishes.
Some database platforms like Oracle and Impala do not truly support temp tables. To emulate temp tables, provide a schema with write privileges where temp tables can be created.
Schema name where your patient-level data in OMOP CDM format resides. Note that for SQL Server, this should include both the database and schema name, for example 'cdm_data.dbo'.
Schema name where your cohort table resides. Note that for SQL Server, this should include both the database and schema name, for example 'scratch.dbo'.
Name of the cohort table.
Generate and export the cohort level time series?
Generate and export the Data source level time series? i.e. using all persons found in observation period table.
(optional) Minimum date for time series. Default value January 1st 1980.
(optional) Maximum date for time series. Default value System date.
Do you want to stratify by Gender
Do you want to stratify by Age group
A vector of one or more Cohort Ids to compute time distribution for.