Created
May 12, 2018 18:13
-
-
Save johnmyleswhite/685b19f63a3b42a0deffe2029a492e19 to your computer and use it in GitHub Desktop.
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
using Distributions | |
using HypothesisTests | |
n_sims = 1_000_000 | |
n = 2 | |
x = Array{Float64}(n) | |
y = Array{Float64}(n) | |
p_d = Array{Float64}(n_sims) | |
for s in 1:n_sims | |
for i in 1:n | |
x[i] = rand(Laplace(0.0, 1.0)) | |
y[i] = rand(Laplace(0.0, 1.0)) | |
end | |
try | |
p_d[s] = pvalue(UnequalVarianceTTest(x, y)) | |
catch | |
p_d[s] = NaN | |
end | |
end | |
mean(isfinite.(p_d)) | |
mean(p_d .< 0.05) | |
mean(p_d .< 0.01) | |
mean(p_d .< 0.001) |
Author
johnmyleswhite
commented
May 12, 2018
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment