Creates time series data frame(s) from defined analysis/analyses
(define_analyses()), device-event data frame
(deviceevent()), and optionally, exposure data frame
(exposure()). If analysis includes covariates or time in-vivo, creates
the relevant supporting data frame.
time_series(analysis, ...)# S3 method for list
time_series(analysis, ...)
# S3 method for mds_das
time_series(analysis, ...)
# S3 method for mds_da
time_series(analysis, deviceevents, exposure = NULL, use_hierarchy = T, ...)
A defined analysis object of class mds_da, list of
class mds_das, or a list of objects each of class mds_da,
usually created by define_analyses().
Further arguments for future work.
A device-event data frame of class mds_de, usually
created by deviceevent(). This should be the same data frame used to
generate analysis.
Optional exposure data frame of class mds_e, usually
created by exposure(). This should be the same data frame used to
generate analysis, if exposure data was used.
Default: NULL will not consider exposure data.
Deprecated - do not use. Logical value indicating whether device and event hierarchies should be used in counting contingency tables for disproportionality analysis.
A standardized MD-PMS time series data frame of class mds_ts.
The data frame contains, by defined date levels, the following columns:
Count of the device & event level of interest. If covariate analysis is indicated, this will be at the covariate & device level of interest.
Optional. Count of the device & non-event, or if covariate analysis,
covariate & non-device. nB will be missing if this is an
'All' level analysis.
Optional. Count of the non-device & event, or if covariate analysis,
non-covariate & device. nC will be missing if this is an
'All' level analysis.
Optional. Count of the non-device & non-event, or if covariate analysis,
non-covariate & non-device. nD will be missing if this is an
'All' level analysis.
List of all keys from deviceevents constituting
nA.
Optional. Count of exposures applicable to nA. This counts at
the device and covariate levels but not at the event level. If a matching
device and/or covariate level is not found, then exposure will be
NA. The exception is an 'All' level analysis, which counts
exposures across all levels.
Optional. List of all exposure keys from exposure
applicable to nA.
The mds_ts class attributes are as follows:
Short description of the analysis.
The analysis definition of class mds_da.
Boolean of whether exposure counts are present.
Boolean of whether 2x2 contingency table counts are present (presumably for disproportionality analysis or 'DPA').
Optional. If dpa is TRUE, list
object containing labels for the DPA contingency table.
Optional. If analysis definition includes covariate level
or time in-vivo, data.frame object containing the relevant data.
list: Generate time series from a list
mds_das: Generate time series from a list of defined analyses
mds_da: Generate time series using defined analysis
# NOT RUN {
de <- deviceevent(maude, "date_received", "device_name", "event_type")
ex <- exposure(sales, "sales_month", "device_name", count="sales_volume")
da <- define_analyses(de, "device_name", exposure=ex)
# Time series on one analysis
time_series(da, de, ex)
# Time series on multiple analyses
time_series(da[1:3], de, ex)
# }
Run the code above in your browser using DataLab