getAchillesTs: Return a monthly multivariate time series of Achilles data...

Description Usage Arguments Details Value

View source: R/getAchillesTs.r

Description

Build a multivariate time series object from one or more concept_ids or a dataframe in the proper format. If supplying a data frame from which to create the time series, it must have the following columns: START_DATE, COUNT_VALUE, PREVALENCE, and PROPORTION_WITHIN_YEAR.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
# Method 1: Create the time series in two steps then access the individual time series.
      # First, get results from Achilles for one or more concept_ids, then transform the results into a time series object.
        AchillesData <- getAchillesMonthlyData (connectionDetails, cdmSchema, resultsSchema, conceptId) 
        achillesTs   <- getAchillesTs(resultSet = AchillesData)
        prevTs       <- achillesTs[,"PREVALENCE"]
        countTs      <- achillesTs[,"COUNT_VALUE"]
        pwyTs        <- achillesTs[,"PROPORTION_WITHIN_YEAR"]
      # Method 2: Create the time series in a single step
        achillesTs   <- getAchillesTs(connectionDetails, cdmSchema, resultsSchema, conceptId)
        prevTs       <- achillesTs[,"PREVALENCE"]
        countTs      <- achillesTs[,"COUNT_VALUE"]
        pwyTs        <- achillesTs[,"PROPORTION_WITHIN_YEAR"]

Arguments

connectionDetails

An R object of type
connectionDetails created using the function createConnectionDetails in the DatabaseConnector package.

cdmSchema

A fully qualified CDM schema name.

resultsSchema

A fully qualified results schema name.

conceptId

One more more valid concept_ids.

resultSet

A dataframe in the proper format (e.g., one returned by
getAchillesMonthlyData)

Details

As the name suggests, this function was designed with Achilles in mind. An Achilles time series is a multivariate time series object consisting of three types of time series: prevalence, count, and proportion within year. The object returned by this function should not be used in your analyses. Instead, you should access the individual time series as per the exaples above. NB: If you supply one or more concept_ids, the data are retrieved from Achilles analysis ids 202,402,602,702,802,1802, and 2102 (corresponding to your concept ids). If you supply a data frame, then it need not come from Achilles as per the example above. It could be any data frame in the correct format.

Value

A multivariate time series object


OHDSI/Castor documentation built on March 20, 2021, 6:09 p.m.