File:PowerOfTest.png

Original file(734 × 774 pixels, file size: 13 KB, MIME type: image/png)

Summary

Description
English: Illustration of the idea of statistical power for a two sided test. Made in R.
Date
Source Own work
Author Fangz


Source code:

par(mfrow = c(2,1), mar = c(2,2,2,2))
t = seq(-4,9, len=200)
plot(t,dnorm(t), type="l", col=0, axes= F, xlab = "", ylab="")
crt=  qnorm(0.975)
polygon(c(crt,crt, t[t>crt]), c(0,dnorm(crt), dnorm(t)[t>crt]), col = 4, lty=0)
polygon(-c(crt,crt, t[t>crt]), c(0, dnorm(crt) ,dnorm(t)[t>crt]), col = 4, lty=0)
abline(h=0)
lines(t,dnorm(t), type="l")
text(-4.5,0.4, "Distribution of statistic under\nNull hypothesis", adj=c(0,0), xpd=NA)
text(3.5, 0.23, "Critical value - value of statistic such \nthat probability of rejection under Null\n(blue area) equals desired\nsignificance level (e.g. 0.05)", adj=c(0,0))
tt= -1
arrows(-2, 0.37, tt, dnorm(tt), length = 0.1)
arrows( 6, 0.2, crt, 0.1, length = 0.1)
plot(t,dnorm(t-crt - qnorm(0.9)), type="l", col=0, axes= F, xlab = "", ylab="")
crt=  qnorm(0.975)
 polygon(c(crt, crt, t[t>crt]), c(0,dnorm( -qnorm(0.9)), dnorm(t-crt - qnorm(0.9))[t>crt]), col = 2, lty=0)
lines(t,dnorm(t-crt - qnorm(0.9)), type="l")
abline(h=0)
abline(v = qnorm(0.975), xpd=NA, lty=2)
text(-4.5,0.4, "Distribution of statistic under\nAlternative hypothesis", adj=c(0,0), xpd=NA)
text(5, 0.3, "Power of test - Probability\nstatistic exceeds critical\nlevel under alternative\n(red area)", adj=c(0,0), xpd=NA)
arrows( 6.5, 0.27, 4, 0.1, length = 0.1)
tt= 0.9
arrows(-2, 0.37, tt, dnorm(tt-crt-qnorm(0.9)), length = 0.1)

Licensing

I, the copyright holder of this work, hereby publish it under the following license:
w:en:Creative Commons
attribution
This file is licensed under the Creative Commons Attribution 4.0 International license.
You are free:
  • to share – to copy, distribute and transmit the work
  • to remix – to adapt the work
Under the following conditions:
  • attribution – You must give appropriate credit, provide a link to the license, and indicate if changes were made. You may do so in any reasonable manner, but not in any way that suggests the licensor endorses you or your use.

Captions

Illustration of the idea of statistical power for a two sided test

Items portrayed in this file

depicts

18 July 2024

image/png

13,522 byte

774 pixel

734 pixel

73f5a1653e1c642838bc985a2d7e0b4ba18890e9

File history

Click on a date/time to view the file as it appeared at that time.

Date/TimeThumbnailDimensionsUserComment
current14:01, 18 July 2024Thumbnail for version as of 14:01, 18 July 2024734 × 774 (13 KB)FangzUploaded own work with UploadWizard
The following pages on the English Wikipedia use this file (pages on other projects are not listed):