make_phr_table2.Rd
Create a dataset that can be used to produce a PHR table 2
make_phr_table2(
...,
effect_measure_type = "RD",
rate_round = 2,
pt_round = 0,
pt_scale = 1,
risk_round = 1,
risk_time = NULL,
alpha = 0.05,
ref = 1,
collapse_CI = FALSE
)
cumrisk
objects supplied as seperate arguments or as a list
The type of effect measure to compute ("RD" risk difference, "RR" relative risk)
The number of significant digits used for rounding the rate when collapse_CI = TRUE
The number of significant digits used for rounding person-time when collapse_CI = TRUE
A scaling factor for the person time (default pt_scale = 1).
The number of significant digits used for rounding the risk
The desired time at which to extract the the cumulative risk and risk difference. If null, uses the maximum time common to all input objects.
The desired nominal significance level of the confidence intervals
The reference category for computing risk differences for groups with >2 levels.
Collapse the estimate and confidence interval to a single value.
A tibble in the format for upload to a PHR using nswpr
models = specify_models(identify_treatment(Statin, formula = ~DxRisk ),
identify_censoring(EndofEnrollment, formula = ~DxRisk),
identify_outcome(Death))
fit2 = estimate_ipwrisk(example1, models,
times = seq(0,24,0.1),
labels = c("IPTCW main analysis"))
make_phr_table2(fit2, risk_time = 24)
#> # A tibble: 14 × 6
#> row column value lcl ucl cell_format
#> <chr> <chr> <chr> <chr> <chr> <chr>
#> 1 Control crisk 0.440783294965121 0.373579331704194 0.50798… CI
#> 2 Control criskfunc NA NA NA CI
#> 3 Control events 470 NA NA Default
#> 4 Control n 3201 NA NA Default
#> 5 Control person_time 22875.1444186661 NA NA Default
#> 6 Control rate 0.0205463183706277 NA NA Default
#> 7 Control time 24 NA NA Default
#> 8 Treat crisk 0.524691612443825 0.500392662700333 0.54899… CI
#> 9 Treat criskfunc 0.0839083174787044 0.011213760989646 0.15660… CI
#> 10 Treat events 2099 NA NA Default
#> 11 Treat n 6799 NA NA Default
#> 12 Treat person_time 63932.5981510698 NA NA Default
#> 13 Treat rate 0.032831451570921 NA NA Default
#> 14 Treat time 24 NA NA Default