This is a generic function to depict the p-value area for a object with class htest
.
# S3 method for class 'htest'
plot(x, col = "red", shade.col = "red", cex = 0.8, from = NULL, to = NULL, ...)
None. Function produces a plot.
# Example
# H0: mu = 170
# Ha: mu != 170 with sigma2=25
x <- rnorm(n=80, mean=171, sd=5)
res <- z.test(x=x, mu=170, sigma2=25, alternative='two.sided')
res
#>
#> One Sample z-test
#>
#> data: x
#> Z = 1.4038, p-value = 0.1604
#> alternative hypothesis: true mean is not equal to 170
#> 95 percent confidence interval:
#> 169.6891 171.8804
#> sample estimates:
#> mean of x
#> 170.7848
#>
plot(res, col='blue', shade.col='tomato')