Last active
November 27, 2015 17:59
-
-
Save richarddmorey/ea7a06f006b201042021 to your computer and use it in GitHub Desktop.
log scale demo
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
t = 2 | |
N = 25 | |
# Create vector of r values from one-fifth the default to five times | |
# the default; a *huge* range | |
r = exp(seq(-log(5),log(5),len=100)+log(sqrt(2)/2)) | |
# Compute BF | |
bf = sapply(r, function(r) BayesFactor::ttest.tstat(t,N,rscale = r,simple=TRUE)) | |
# Plots | |
par(mfrow=c(1,2),las=1) | |
# Not log scaled | |
plot(r,bf,ty='l') | |
abline(v=sqrt(2)/2,col="gray") | |
# Log scaled | |
plot(r,bf,ty='l',log="xy") | |
abline(v=sqrt(2)/2,col="gray") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment