Skip to content

Instantly share code, notes, and snippets.

@MJacobs1985
Created September 30, 2021 18:36
Show Gist options
  • Save MJacobs1985/e3b9be840d5afd62d9fa3aa4313186c2 to your computer and use it in GitHub Desktop.
Save MJacobs1985/e3b9be840d5afd62d9fa3aa4313186c2 to your computer and use it in GitHub Desktop.
How many samples do you need
## Plot Power curve
ggplot(powervalue,
aes(x=N,
y=Power,
col=ES,
group=ES))+
geom_line() +
theme_bw()+
scale_x_discrete(limits=seq(1,35,1))+
geom_hline(yintercept=80, linetype="dashed", color = "red", size=0.5)+
scale_colour_gradient2(midpoint=25,low="red",mid="orange",high = "green")+
labs(x="Number of Fish", y="Power",
title="Power Curve for Number of Fish Randomly Selected from a Dataset with a Significant Model Effect")
ggsave("PowerCurve.png", plot = last_plot(), device = NULL, path = NULL,
scale = 1, width = 15, height = 10, units = "in",
dpi = 600)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment