plot.htest: To plot p-value area

View source: R/plot.htest.R

plot.htestR Documentation

To plot p-value area

Description

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

Usage

## S3 method for class '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
plot(res, col='blue', shade.col='tomato')


fhernanb/stests documentation built on March 29, 2025, 10:36 a.m.