PREPROCESS: Raw data process

Description Usage Arguments Details Value Note Examples

Description

preprocess reorganizes the datasets by adverse events (AE), so that it can be used for further analysis.
PREplot plot the risk difference or odds ratio calculated from Raw data.

Usage

1
2
3
preprocess(adsl, adae)

PREplot(aedata, ptnum = 50, param = "risk difference")

Arguments

adsl

subject level analysis dataset, it is a .csv file, it has to contain at least two columns, "USUBJID" and "TRTCTR", "TRTCTR" is the indicator for treatment and control group. TRTCTR=1 for treatment group and TRTCTR=0 for control group.

adae

adverse event analysis dataset, it is a .csv file, it has to contain at least three columns, "USUBJID", "AEBODSYS",and "AEDECOD"

aedata

the output dataset from function preprocess

ptnum

an integer, number of PTs to plot, with default be 50

param

a string, summary statistics based for plotting, either 'risk difference' or 'odds ratio', with default be 'risk difference'

Details

preprocess sums up the number of patients in control and treatment group. Also this function calculates the number of patients experiencing the AE for each AE in control and treatment group. It also contains columns, "b", "i", "j" for further analysis.
PREplot calculate the risk difference or odds ratio from Raw data and plot top AEs with highest raw risk difference or with highest odds ratio. User can select which summary statistics('risk difference' or 'odds ratio') the plot the based on and also the number of adverse events to plot out.

Value

preprocess returns a dataframe with following columnss:
AEBODSYS: Body System or SoC for AE
AEDECOD: Peferred Term (PT) for AE
AEc: number of patients in control group having each specific AE
AEt: number of patients in treatment group having each specific AE
Nc: number of total patients in control group
Nt: number of total patients in treatmetn group
b: integer represents each Soc
i: integer represents each PT
j: order of PT in each SoC
Raw_Risk_Diff: Risk difference between treatment and control group
Raw_OR: Odds ratio of the risk treatment/control

Note

Make sure that adsl and adae contain the required columns with exact the same column names as listed in "parameters" section.

Examples

1
2
3
4
5
6
7
8
9
## Not run: 
data(ADAE)
data(ADSL)
AEdata<-preprocess(adsl=ADSL, adae=ADAE)
PREplot(aedata=AEdata)
# user can use a very big number(bigger than total PTs in dataset) to plot out all the PTs
PREplot(aedata=AEdata, ptnum=50000, param='odds ratio')

## End(Not run)

ganluan123/FlagAE documentation built on Nov. 4, 2019, 1:02 p.m.