Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
log scale demo
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
You can’t perform that action at this time.