pnullSamp | R Documentation |
Calculates the probability of a one sided null hypothesis from a sample from a posterior density.
pnullSamp(theta, theta0 = 0, type = "upper")
theta |
a sample of values from a posterior density |
theta0 |
the hypothesized value, i.e. H0: theta <= theta0 |
type |
the type of probability to return, 'lower' = Pr(theta <= theta0) or 'upper' = Pr(theta >= theta0). It is sufficient to use 'l' or 'u' |
This function uses linear interpolation to calculate bounds for points that may not be specified by CDF
a list containing the element prob which will be the upper or lower tail probability depending on type
## The posterior density is N(3,1) theta = rnorm(1000,3) ## test whether the true mean is greater than 0 (it is obviously!) pnullSamp(theta)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.