-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
# anchored example using kmplot | ||
# anchored example using kmplot2 | ||
|
||
data(weighted_twt) | ||
data(adtte_twt) | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# Anchored example using maic_anchored for binary outcome | ||
|
||
data(weighted_twt) | ||
data(adtte_twt) | ||
data(pseudo_ipd_twt) | ||
|
||
# Reported summary data | ||
pseudo_adrs <- get_pseudo_ipd_binary( | ||
binary_agd = data.frame( | ||
ARM = c("B", "C", "B", "C"), | ||
RESPONSE = c("YES", "YES", "NO", "NO"), | ||
COUNT = c(280, 120, 200, 200) | ||
), | ||
format = "stacked" | ||
) | ||
|
||
# inferential result | ||
result_binary <- maic_anchored( | ||
weights_object = weighted_twt, | ||
ipd = adrs_twt, | ||
pseudo_ipd = pseudo_adrs, | ||
trt_var_ipd = "ARM", | ||
trt_var_agd = "ARM", | ||
trt_ipd = "A", | ||
trt_agd = "B", | ||
trt_common = "C", | ||
endpoint_name = "Binary Event", | ||
endpoint_type = "binary", | ||
eff_measure = "OR" | ||
) | ||
|
||
result_binary$inferential$report_overall_robustCI | ||
result_binary$inferential$report_overall_bootCI |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
data(adrs_sat) | ||
|
||
testdat <- data.frame(Yes = 280, No = 120) | ||
rownames(testdat) <- "B" | ||
pseudo_ipd_binary_sat <- get_pseudo_ipd_binary( | ||
binary_agd = testdat, | ||
format = "unstacked" | ||
) | ||
combined_data <- rbind(adrs_sat[, c("USUBJID", "RESPONSE", "ARM")], pseudo_ipd_binary_sat) | ||
combined_data$ARM <- as.factor(combined_data$ARM) | ||
|
||
binobj_dat <- glm(RESPONSE ~ ARM, combined_data, family = binomial(link = "logit")) | ||
report_table_binary(binobj_dat, eff_measure = "OR") |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
data(adtte_sat) | ||
data(pseudo_ipd_sat) | ||
combined_data <- rbind(adtte_sat[, c("TIME", "EVENT", "ARM")], pseudo_ipd_sat) | ||
unweighted_cox <- coxph(Surv(TIME, EVENT == 1) ~ ARM, data = combined_data) | ||
|
||
# Derive median survival time | ||
kmobj <- survfit(Surv(TIME, EVENT) ~ ARM, combined_data, conf.type = "log-log") | ||
medSurv <- medSurv_makeup(kmobj, legend = "before matching", time_scale = "day") | ||
|
||
report_table_tte(unweighted_cox, medSurv) | ||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.