This file contains hidden or 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
#Standardized p-value | |
#This is untested alpha software provided with no guarantees - use at your own risk | |
#Good 1982: P SQRT(N/100) | |
#Enter the observed p-value and the sample size | |
p_stan <- function(p, N){ | |
p * sqrt(N/100) | |
} |
This file contains hidden or 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
#Load packages | |
library(readxl) | |
library(mailR) | |
#Read student data | |
info <- read_excel("student_names_email.xls", | |
sheet = 1, | |
col_names = TRUE) | |
#Loop from 1 to the number of email addresses in the spreadsheet |
This file contains hidden or 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
options(scipen=999) #disable scientific notation for numbers | |
#Figure 1 & 2 (set to N <- 5000 for Figure 2) | |
# Set x-axis upper and lower scalepoint (to do: automate) | |
low_x<--1 | |
high_x<-1 | |
y_max<-2 | |
#Set sample size per group and effect size d (assumes equal sample sizes per group) | |
N<-50 #sample size per group for indepndent t-test |
This file contains hidden or 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
NAME | COMMENTS | HITS | DATE | |
---|---|---|---|---|
Equivalence testing in jamovi | 12 | 1870 | 14-3-2017 | |
No the p-values are not to blame: Part 53 | 1 | 2675 | 10-3-2017 | |
How p-values solve 50% of the problems with p-values | 4 | 2273 | 6-3-2017 | |
ROPE and Equivalence Testing: Practically Equivalent? | 9 | 1991 | 12-2-2017 | |
Examining Non-Significant Results with Bayes Factors and Equivalence Tests | 26 | 2332 | 29-1-2017 | |
Why Type 1 errors are more important than Type 2 errors (if you care about evidence) | 32 | 7435 | 18-12-2016 | |
TOST equivalence testing R package (TOSTER) and spreadsheet | 8 | 3885 | 9-12-2016 | |
Why Within-Subject Designs Require Fewer Participants than Between-Subject Designs | 0 | 4792 | 12-11-2016 | |
Improving Your Statistical Inferences Coursera course | 7 | 3154 | 6-10-2016 |
This file contains hidden or 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
#Make sure JAGS is installed or R will crash: https://sourceforge.net/projects/mcmc-jags/files/JAGS/4.x/ | |
require(BEST) #To calculate HDI | |
require(TOSTER) #To calculate Equivalence Tests | |
set.seed(1) | |
x<-rnorm(100) #Generate 100 random normally distributed observations | |
y<-rnorm(100) #Generate 100 random normally distributed observations | |
#ROPE test |
This file contains hidden or 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
# Code from https://osf.io/aqi5j/ made by original authors, adapted by Daniel Lakens | |
# Download the csv file from https://osf.io/aqi5j/ | |
# Paper: http://www.tandfonline.com/doi/full/10.1080/23743603.2016.1273647 | |
require(car) | |
# IMPORTANT: change this to match your path/file | |
fileLocation <- 'C:\\Users\\Daniel\\surfdrive\\Data\\blog volunteer study\\VolunteeringDataFile_05.09.16.csv' | |
# Dienes functions |
This file contains hidden or 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
#Create single plot for graph---- | |
power <- seq(0.01,1,0.01) | |
alpha <- seq(0.01,1,0.01) | |
pH0 <- 0.5 | |
tp<-((1-pH0)*power) | |
fp<-((pH0)*alpha) | |
likelihood_ratio<-outer(tp, fp, "/") | |
#Create color shading | |
nrz<-nrow (likelihood_ratio) |
This file contains hidden or 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
if(!require(ggplot2)){install.packages('ggplot2')} | |
library(ggplot2) | |
if(!require(Rcpp)){install.packages('Rcpp')} | |
library(Rcpp) | |
if(!require(MASS)){install.packages('MASS')} | |
library(MASS) | |
options(digits=10,scipen=999) | |
#Set color palette |
This file contains hidden or 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
if(!require(BayesFactor)){install.packages('BayesFactor')} | |
library(BayesFactor) | |
#to get emoticons for each test, set wait to 0.5 and showfaces to 1. | |
#When running large number of simulations, set wait to 0 and showfaces to 0. | |
options(scipen=20) #disable scientific notation for numbers | |
waitx<-0.5 #To see a small wait between individual trials, set a wait time to e.g., 0.5 | |
showfaces<-1 #Set to 0 if you do not want the faces, set to 1 if you want to see the faces | |
cohensd<-0.3 #set true effect size | |
n<-75 #sample size in each group |
This file contains hidden or 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
if(!require(ggplot2)){install.packages('ggplot2')} | |
library(ggplot2) | |
if(!require(pwr)){install.packages('pwr')} | |
library(pwr) | |
nSims <- 100000 #number of simulated experiments | |
M<-106 #Mean IQ score in the sample | |
n<-26 #set sample size | |
SD<-15 #SD of the simulated data |