powered by
Calculates the probability of a one sided null hypothesis from a sample from a posterior density.
pnullSamp(theta, theta0 = 0, type = "upper")
a sample of values from a posterior density
the hypothesized value, i.e. H0: theta <= theta0
the type of probability to return, 'lower' = Pr(theta <= theta0) or 'upper' = Pr(theta >= theta0). It is sufficient to use 'l' or 'u'
a list containing the element prob which will be the upper or lower tail probability depending on type
This function uses linear interpolation to calculate bounds for points that may not be specified by CDF
# NOT RUN { ## 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) # }
Run the code above in your browser using DataLab