It notes here that N-P approach does not utilize the information in the accurate p value. Actually, at the time N-P approach was firstly devised, the accurate p value was not available usually. Now almost all statistic softwares provide accurate p values and the N-P approach becomes obsolete. Wilkinson & APA TFSI (1999) recommended to report the accurate p value rather than just significance/insignificance, unless p is smaller than any meaningful precision.
p_prior<-0.22;
##try p_prior<-0.82 to demo significant repetition once more
p_alpha<-0.05;
p_power<-0.8;
##-----------------
op <- par(mfrow=c(1,2));
h_1_s<-p_power*p_prior/(p_alpha*(1-p_prior)+p_power*p_prior);
h_0_i<-(1-p_alpha)*(1-p_prior)/((1-p_alpha)*(1-p_prior)+(1-p_power)*p_prior);
##
D<-matrix(c(1-p_alpha,p_alpha,1-p_power,p_power),nrow=2);
rownames(D)<-c("Insig","Sig");
colnames(D)<-c(paste(1-p_prior,"H_0"),paste(p_prior,"H_1"));
barplot(D
,width=c(1-p_prior,p_prior)
,legend = rownames(D)
,space=0
,col=c(gray(0.6),gray(0.9)),asp=1
);
title(main=paste("Sig: H_1 from",p_prior,"to"
,round(h_1_s,digits=2)
,"\n","Insig: H_0 from",1-p_prior,"to"
,round(h_0_i,digits=2)
)
,sub=paste(round(h_1_s,digits=2),"=(",p_power,"*",p_prior,")/("
,p_alpha,"*",1-p_prior,"+",p_power,"*",p_prior,")"
,"\n",round(h_0_i,digits=2)
,"=(",1-p_alpha,"*",1-p_prior,")/("
,1-p_alpha,"*",1-p_prior,"+",1-p_power,"*",p_prior,")"
)
);
##
v_power<-c(0.1,(5:9)/10);
v_prior<-(1:1000)/1000;
n<-length(v_power);
v_c<-sample(colors())[1:n];
plot(v_prior,v_prior,type=”l”,col=”black”
,xlab=”a_prior”,ylab=”post_hoc”,asp=1
,xlim=c(0,1),ylim=c(0,1),main=”Power=.1,.5,.6,.7,.8, and .9″);
lines(v_prior,1-v_prior);
for (i in 1:n){
p_power<-v_power[i];
v_1_s<-p_power*v_prior/(p_alpha*(1-v_prior)+p_power*v_prior);
v_0_i<-(1-p_alpha)*(1-v_prior)/((1-p_alpha)*(1-v_prior)+(1-p_power)*v_prior);
lines(v_prior,v_1_s,col=v_c[i])
lines(v_prior,v_0_i,col=v_c[i])
}
points(p_prior,h_1_s,col=”red”);
points(p_prior,p_prior,col=”red”);
points(p_prior,h_0_i,col=”blue”);
points(p_prior,1-p_prior,col=”blue”);
par(op);
–
Wilkinson, L. & APA TFSI (1999). Statistical methods in psychology journals: Guidelines and explanations. American Psychologist, 54, 594-604.

{ 3 } Comments
It is interesting to verify whether two independent significant repetitions will persuade peers more than the combined whole data set does.
Easy to understand the R script ,but hard to understand the meaning…
##If you guess the point has 22% probability to fall in the H_1 region, you will update the probability to 82% after you know it fall in the light gray region with a significant exp report.
##to demo Prosecutor’s fallacy on wiki
p_prior=10e-7;##if the defendant is not different From any one of the 10 million population except the DNA test result
p_alpha=0.0001;##”it is testified that the probability that two DNA profiles match by chance is only 1 in 10,000″
p_power=1; ##Let’s assume the power is extreme
##
(h_1_s=p_power*p_prior/(p_alpha*(1-p_prior)+p_power*p_prior));
## the Procecutor mistook the 0.99% target percent as 99.99%.
##——————————-
##to demo the Defendant’s fallacy
p_prior=10e-2;##”The video (evidence) suggests a 99% (rather than 1-10e-7) chance that the defendant is innocent”, except the DNA test result
p_alpha=0.0001;##as the former
p_power=1; ##as the former
##
(h_1_s=p_power*p_prior/(p_alpha*(1-p_prior)+p_power*p_prior));
## the target percentage should be 99.91% rather than 0.99%
Post a Comment