science-notes/source/statistics/code/ztest_pvalue.R
2023-10-18 20:32:31 +02:00

6 lines
178 B
R

N=rnorm(9999999,mean=0,sd=1)
cdf=ecdf(N)
zscore=-1.8
message(paste0("Alpha approximated is ",cdf(zscore)))
message(paste0("Alpha from built-in CDF ",pnorm(zscore,mean=0,sd=1)))