Skip to content

Commit

Permalink
Updated the x-axis for figures.
Browse files Browse the repository at this point in the history
  • Loading branch information
mbannick committed Aug 9, 2023
1 parent 07278a1 commit 9703462
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 9 deletions.
4 changes: 2 additions & 2 deletions results/figure-4-5.R
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ df[afunc == "pocock", bound_type := "Pocock"]
# FIGURE 4 -----------------------------------

pdf("~/repos/Group-Sequential-Trials-Paper/figures/type1error-2.pdf", height=5, width=10)
ggplot(data=df[delta == 0.0 & stages == 3], aes(x=1-rho, y=power, color=label)) +
ggplot(data=df[delta == 0.0 & stages == 3], aes(x=1-rho**2, y=power, color=label)) +
facet_grid(bound_type ~ n) +
geom_point() +
geom_hline(yintercept=0.05, linetype="dashed", color="black") +
Expand All @@ -44,7 +44,7 @@ dev.off()
# FIGURE 4 -----------------------------------

pdf("~/repos/Group-Sequential-Trials-Paper/figures/power-2.pdf", height=5, width=10)
ggplot(data=df[delta == 0.1 & stages == 3], aes(x=1-rho, y=power, color=label)) +
ggplot(data=df[delta == 0.1 & stages == 3], aes(x=1-rho**2, y=power, color=label)) +
facet_grid(bound_type ~ n) +
geom_point() + geom_line() +
scale_color_brewer(palette="Set1") +
Expand Down
12 changes: 6 additions & 6 deletions results/figure-A1.R
Original file line number Diff line number Diff line change
Expand Up @@ -20,22 +20,22 @@ df[afunc == "pocock", bound_type := "Pocock"]
# FIGURE A1 -----------------------------------

pdf("~/repos/Group-Sequential-Trials-Paper/figures/type1error-A1.pdf", height=8, width=10)
ann_text <- data.frame(rho=1-0.4, power=0.085,
ann_text <- data.frame(rho=1-0.3, power=0.085,
lab="No anticipated reduction",
design_rho=1,
n=factor(50, levels=c(50, 100, 250, 1000)),
bound_type="OBF")
ann_text2 <- data.frame(rho=1-0.6, power=0.06,
ann_text2 <- data.frame(rho=1-0.55, power=0.06,
lab="Anticipated and true\nreduction match",
design_rho=1,
n=factor(50, levels=c(50, 100, 250, 1000)),
bound_type="OBF")
extra_point <- data.frame(rho=1-0.35, power=0.06,
extra_point <- data.frame(rho=1-0.3, power=0.06,
design_rho=1,
n=factor(50, levels=c(50, 100, 250, 1000)),
bound_type="OBF")
ggplot(data=df[delta == 0.0],
aes(x=1-rho, y=power, color=1-design_rho, group=1-design_rho)) +
aes(x=1-rho**2, y=power, color=1-design_rho**2, group=1-design_rho**2)) +
facet_grid(bound_type~n) +
geom_point(size=1, fill="white") +
geom_hline(yintercept=0.05, linetype="dashed", color="black") +
Expand All @@ -44,7 +44,7 @@ ggplot(data=df[delta == 0.0],
scale_color_viridis(option="D") +
scale_fill_viridis(option="D", guide = 'none') +
geom_star(data=df[rho == design_rho & delta == 0.0],
size=3, aes(fill=1-design_rho)) +
size=3, aes(fill=1-design_rho**2)) +
theme(legend.position="top") +
labs(color="Anticipated Reduction in Variance",
fill=NA,
Expand All @@ -53,7 +53,7 @@ ggplot(data=df[delta == 0.0],
x="Reduction in variance by using ANCOVA") +
geom_text(data=ann_text, aes(label=lab), size=3) +
geom_segment(
x = 0.5, xend = 0.53, y = 0.083, yend = 0.0775,
x = 0.5, xend = 0.53, y = 0.083, yend = 0.076,
arrow = arrow(length = unit(5, "pt")),
data=ann_text
) +
Expand Down
3 changes: 2 additions & 1 deletion simulations/copy-files.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/bin/sh
mkdir /Users/marlena/Documents/FileZilla/rct/$1

scp mnorwood@bayes.biostat.washington.edu:/home/students/mnorwood/rct/$1/\{summary.csv,DESCRIPTION.txt\} /Users/marlena/Documents/FileZilla/rct/$1
scp mnorwood@bayes0.biostat.washington.edu:/home/students/mnorwood/rct/$1/DESCRIPTION.txt /Users/marlena/Documents/FileZilla/rct/$1

scp mnorwood@bayes0.biostat.washington.edu:/home/students/mnorwood/rct/$1/summary.csv /Users/marlena/Documents/FileZilla/rct/$1

0 comments on commit 9703462

Please sign in to comment.