-
Notifications
You must be signed in to change notification settings - Fork 3
/
examples.R
22 lines (12 loc) · 1.04 KB
/
examples.R
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# EXAMPLES - data simulation using NCC package
devtools::install_github("pavlakrotka/NCC", build_vignettes = TRUE)
library(NCC)
set.seed(123)
## Continuous endpoints - equal linear time trends; alternative hypothesis
cont_eq <- datasim_cont(num_arms = 3, n_arm = 100, d = c(0, 100, 250), theta = rep(0.25, 3), lambda = rep(0.15, 4), sigma = 1, trend = "linear")
## Continuous endpoints - different linear time trends; alternative hypothesis
cont_diff <- datasim_cont(num_arms = 3, n_arm = 100, d = c(0, 100, 250), theta = rep(0.25, 3), lambda = c(0.1, 0.15, 0.1, 0.1), sigma = 1, trend = "stepwise")
## Binary endpoints - equal linear time trends; alternative hypothesis
bin_eq <- datasim_bin(num_arms = 3, n_arm = 100, d = c(0, 100, 250), p0 = 0.7, OR = rep(1.8, 3), lambda = rep(0.15, 4), trend = "linear")
## Binary endpoints - different linear time trends; alternative hypothesis
bin_diff <- datasim_bin(num_arms = 3, n_arm = 100, d = c(0, 100, 250), p0 = 0.7, OR = rep(1.8, 3), lambda = c(0.1, 0.15, 0.1, 0.1), trend = "linear")