This is a generic function to depict the p-value area for a object with class htest.

# S3 method for htest
plot(x, col = "red", shade.col = "red", cex = 0.8, from = NULL, to = NULL, ...)

Arguments

x

Object of class “htest”.

col

color for the observed statistic.

shade.col

color for the shaded area.

cex

a numerical value giving the amount by which plotting the p-value.

from

the minimum value of the X-axis.

to

the maximum value of the X-axis.

...

Other plotting parameters to affect the plot.

Value

None. Function produces a plot.

Examples


# 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 = 2.9986, p-value = 0.002712
#> alternative hypothesis: true mean is not equal to 170
#> 95 percent confidence interval:
#>  170.5806 172.7719
#> sample estimates:
#> mean of x 
#>  171.6763 
#> 
plot(res, col='blue', shade.col='tomato')