This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Binomial distribution of 30 attempts with a probability of .5, simulated 100,000 times | |
g <- rbinom(100000, 30, .5) | |
graph1 <- hist(g,xlab = expression(paste(italic(n),'=30, ', italic(P),'=.5')),main = "Simulated data for 30 trials with a probabiltiy of .5", col = "skyblue2") | |
#Binomial distribution of 30 attempts with a probability of .15, simulated 100,000 times | |
h <- rbinom(100000, 30, .15) | |
graph2 <- hist(h,xlab = expression(paste(italic(n),'=30, ', italic(P),'=.15')),main = "Simulated data for 30 trials with a probabiltiy of .15", col = "skyblue2") | |
#Binomial distribution of 30 attempts with a probability of .001, simulated 100,000 times | |
j <- rbinom(100000, 30, .01) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
parameter_grid <- expand.grid(n = c(32, 64), | |
d = seq(0.05, 2, by = 0.05), | |
sd = seq(1, 2, by = 0.2)) | |
parameter_grid$power <- power.t.test(n = parameter_grid$n, delta = parameter_grid$d, sd = parameter_grid$sd)$power | |
library(tidyverse) | |
parameter_grid$n <- paste(parameter_grid$n, "pro group") | |
ggplot(parameter_grid, | |
aes(x = d, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Gender | |
#Create a string called "BlogName" with all the names of the different blogs in it | |
BlogName<-c("Brown", "Coyne", "Allen", "Neurobonkers", "Sakaluk", "Heino", "Kruschke", "Giner-Sorolla", "Magnusson", "Zwaan", "CogTales", "Campbell", "Vanderkerckhove", "Mayo", "Funder", "Schonbrodt", "Fried", "Coyne", "Yarkoni", "Neuroskeptic", "JEPS", "Morey", "PsychBrief", "DataColada", "Innes-Ker", "Schwarzkopf", "PIG-E", "Rousselet", "Gelman", "Bishop", "Srivastava", "Vazire", "Etz", "Bastian", "Zee", "Schimmack", "Hilgard", "Rouder", "Lakens") | |
#Create a vector called "BlogGender" with a string of numbers to represent either female, male, or N/a | |
BlogGender<-c(2,2,2,2,2,2,2,2,2,2,1,1,2,2,1,2,2,2,2,2,2,3,2,1,2,2,2,1,2,2,2,2,1,2,1,2,1,2,2,2,2,2) | |
#Turn BlogGender into a factor where 1 is labelled Female, 2 male, and 3 N/a | |
BlogGender<-factor(BlogGender, levels= c(1:3), labels =c("Female","Male", "N/a")) | |
#Create a data frame of the variable BlogName by the variable BlogGender | |
Blogs<-data.frame(Name=BlogName, Gender=BlogG |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#n=2267 | |
#Calculating the smallest partial eta squared the study could detect given smallest effect size f it could detect at 95% power | |
f95<-c(0.0757429) | |
eta^2 = f^2 / ( 1 + f^2 ) | |
(f95*f95)/(1+f95*f95) | |
0.005704262 | |
#Calculating the smallest partial eta squared the study could detect given smallest effect size f it could detect at 80% power | |
f80<-c(0.0588656) | |
(f80*f80)/(1+f80*f80) |