gs_info_rd | R Documentation |
Information and effect size under risk difference
gs_info_rd( p_c = tibble::tibble(Stratum = "All", Rate = 0.2), p_e = tibble::tibble(Stratum = "All", Rate = 0.15), N = tibble::tibble(Stratum = "All", N = c(100, 200, 300), Analysis = 1:3), rd0 = 0, ratio = 1, weight = c("un-stratified", "ss", "invar") )
p_c |
rate at the control group |
p_e |
rate at the experimental group |
N |
sample size |
rd0 |
the risk difference under H0 |
ratio |
Experimental:Control randomization ratio |
weight |
weigting method, either "un-stratified" or "ss" or "invar" |
library(tibble) # --------------------- # # example 1 # # --------------------- # # un-stratified case with H0: rd0 = 0 gs_info_rd( p_c = tibble(Stratum = "All", Rate = .15), p_e = tibble(Stratum = "All", Rate = .1), N = tibble(Stratum = "All", N = c(100, 200, 300), Analysis = 1:3), rd0 = 0, ratio = 1 ) # --------------------- # # example 2 # # --------------------- # # un-stratified case with H0: rd0 != 0 gs_info_rd( p_c = tibble(Stratum = "All", Rate = .2), p_e = tibble(Stratum = "All", Rate = .15), N = tibble(Stratum = "All", N = c(100, 200, 300), Analysis = 1:3), rd0 = 0.005, ratio = 1 ) # --------------------- # # example 3 # # --------------------- # # stratified case under sample size weighting and H0: rd0 = 0 gs_info_rd( p_c = tibble(Stratum = c("S1", "S2", "S3"), Rate = c(.15, .2, .25)), p_e = tibble(Stratum = c("S1", "S2", "S3"), Rate = c(.1, .16, .19)), N = tibble(Stratum = rep(c("S1", "S2", "S3"), each = 3), Analysis = rep(1:3, 3), N = c(50, 100, 200, 40, 80, 160, 60, 120, 240)), rd0 = 0, ratio = 1, weight = "ss") # --------------------- # # example 4 # # --------------------- # # stratified case under inverse variance weighting and H0: rd0 = 0 gs_info_rd( p_c = tibble(Stratum = c("S1", "S2", "S3"), Rate = c(.15, .2, .25)), p_e = tibble(Stratum = c("S1", "S2", "S3"), Rate = c(.1, .16, .19)), N = tibble(Stratum = rep(c("S1", "S2", "S3"), each = 3), Analysis = rep(1:3, 3), N = c(50, 100, 200, 40, 80, 160, 60, 120, 240)), rd0 = 0, ratio = 1, weight = "invar") # --------------------- # # example 5 # # --------------------- # # stratified case under sample size weighting and H0: rd0 != 0 gs_info_rd( p_c = tibble(Stratum = c("S1", "S2", "S3"), Rate = c(.15, .2, .25)), p_e = tibble(Stratum = c("S1", "S2", "S3"), Rate = c(.1, .16, .19)), N = tibble(Stratum = rep(c("S1", "S2", "S3"), each = 3), Analysis = rep(1:3, 3), N = c(50, 100, 200, 40, 80, 160, 60, 120, 240)), rd0 = 0.02, ratio = 1, weight = "ss") # --------------------- # # example 6 # # --------------------- # # stratified case under inverse variance weighting and H0: rd0 != 0 gs_info_rd( p_c = tibble(Stratum = c("S1", "S2", "S3"), Rate = c(.15, .2, .25)), p_e = tibble(Stratum = c("S1", "S2", "S3"), Rate = c(.1, .16, .19)), N = tibble(Stratum = rep(c("S1", "S2", "S3"), each = 3), Analysis = rep(1:3, 3), N = c(50, 100, 200, 40, 80, 160, 60, 120, 240)), rd0 = 0.02, ratio = 1, weight = "invar") # --------------------- # # example 7 # # --------------------- # # stratified case under inverse variance weighting and H0: rd0 != 0 and # rd0 difference for different statum gs_info_rd( p_c = tibble(Stratum = c("S1", "S2", "S3"), Rate = c(.15, .2, .25)), p_e = tibble(Stratum = c("S1", "S2", "S3"), Rate = c(.1, .16, .19)), N = tibble(Stratum = rep(c("S1", "S2", "S3"), each = 3), Analysis = rep(1:3, 3), N = c(50, 100, 200, 40, 80, 160, 60, 120, 240)), rd0 = tibble(Stratum = c("S1", "S2", "S3"), rd0 = c(0.01, 0.02, 0.03)), ratio = 1, weight = "invar")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.