Analysis preparation
The input of the function prepare_exp_duration()
is a
meta
object created by the metalite package. The resulting
output comprises a collection of raw datasets for analysis and
reporting.
outdata <- prepare_exp_duration(meta)
outdata
## List of 14
## $ meta :List of 7
## $ population : chr "apat"
## $ observation : chr "apat"
## $ parameter : chr "expdur"
## $ n :'data.frame': 1 obs. of 6 variables:
## $ order : NULL
## $ group : chr "TRTA"
## $ reference_group: NULL
## $ char_n :List of 1
## $ char_var : chr "AVAL"
## $ char_prop :List of 1
## $ var_type :List of 1
## $ group_label : Factor w/ 3 levels "Placebo","Low Dose",..: 1 3 2
## $ analysis : chr "exp_dur"
Number of participants in population
## name n_1 n_2 n_3 n_9999
## 1 Participants in population 86 83 84 253
Number of participants in each duration category
charn <- data.frame(outdata$char_n[1])
head(charn[, 1:5], 6)
## name Placebo Low.Dose High.Dose Total
## 1 not treated 0 0 0 0
## 2 >=1 day 2 4 3 9
## 3 >=7 days 13 11 9 33
## 4 >=28 days 31 20 27 78
## 5 >=12 weeks 39 48 45 132
## 6 >=24 weeks 1 0 0 1
Proportion of participants in each duration category
charp <- data.frame(outdata$char_prop[1])
head(charp[, 1:5], 6)
## name Placebo Low.Dose High.Dose Total
## 1 not treated 0.000000 0.000000 0.000000 0.0000000
## 2 >=1 day 2.325581 4.819277 3.571429 3.5573123
## 3 >=7 days 15.116279 13.253012 10.714286 13.0434783
## 4 >=28 days 36.046512 24.096386 32.142857 30.8300395
## 5 >=12 weeks 45.348837 57.831325 53.571429 52.1739130
## 6 >=24 weeks 1.162791 0.000000 0.000000 0.3952569
Statistical summary of exposure duration for each treatment
chars <- data.frame(outdata$char_n[1])
tail(chars[, 1:5], 8)
## name Placebo Low.Dose High.Dose Total
## 8 Mean 81.5 90.8 87.6 86.6
## 9 SD 49.1 51.3 48.8 49.7
## 10 SE 5.3 5.6 5.3 3.1
## 11 Median 76.0 93.0 90.0 88.0
## 12 Min 3.0 1.0 4.0 1.0
## 13 Max 168.0 167.0 167.0 168.0
## 14 Q1 to Q3 41.25 to 123.25 48 to 137.5 44.75 to 129.25 44 to 133
## 15 Range 3 to 168 1 to 167 4 to 167 1 to 168
Output as RTF
rtf_exp_duration
to generate RTF output
outdata <- format_exp_duration(outdata, display_col = c("n", "prop", "total")) |>
rtf_exp_duration(
source = "Source: [CDISCpilot: adam-adexsum]",
path_outdata = tempfile(fileext = ".Rdata"),
path_outtable = "outtable/exp0duration.rtf"
)
## The outdata is saved in/rtmp/RtmpkBEdeP/file3606c11b807918.Rdata
## The output is saved in/rtmp/Rtmp7YMja5/Rbuild3605e43666ac3c/metalite.sl/vignettes/outtable/exp0duration.rtf