Description Usage Arguments Author(s) See Also Examples
A simple function for obtaining the plot of power of UMP test.
1 | powertestplot(mu0, sigma, n, alpha)
|
mu0 |
the value of mean |
sigma |
standard deviation |
n |
sample size |
alpha |
size of the test |
Prabhanjan N. Tattar
t.test
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 | UMPNormal <- function(mu0, sigma, n,alpha) {
qnorm(alpha)*sigma/sqrt(n)+mu0
}
UMPNormal(mu0=0, sigma=1,n=1,alpha=0.5)
powertestplot <- function(mu0,sigma,n,alpha) {
mu0seq <- seq(mu0-3*sigma, mu0+3*sigma,(6*sigma/100))
betamu <- pnorm(sqrt(n)*(mu0seq-mu0)/sigma-qnorm(1-alpha))
plot(mu0seq,betamu,"l",xlab=expression(mu),ylab="Power of UMP Test",
main = expression(paste("H:",mu <= mu[0]," vs K:",mu>mu[0])))
abline(h=alpha)
abline(v=mu0)
}
powertestplot(mu0=0,sigma=1,n=10,alpha=0.05)
# H:mu > mu_0 vs K: mu <= mu_0
UMPNormal <- function(mu0, sigma, n,alpha) {
mu0-qnorm(alpha)*sigma/sqrt(n)
}
UMPNormal(mu0=0, sigma=1,n=1,alpha=0.5)
powertestplot <- function(mu0,sigma,n,alpha) {
mu0seq <- seq(mu0-3*sigma, mu0+3*sigma,(6*sigma/100))
betamu <- pnorm(sqrt(n)*(mu0-mu0seq)/sigma-qnorm(1-alpha))
plot(mu0seq,betamu,"l",xlab=expression(mu),ylab="Power of UMP Test",
main=expression(paste("H:",mu >= mu[0]," vs K:",mu<mu[0])))
abline(h=alpha)
abline(v=mu0)
}
powertestplot(mu0=0,sigma=1,n=10,alpha=0.05)
|
[1] 0
[1] 0
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.