ci.bayes.spcor: Bayesian credible interval for a semipartial correlation with...

View source: R/statpsych2.R

ci.bayes.spcorR Documentation

Bayesian credible interval for a semipartial correlation with a skeptical prior

Description

Computes an approximate Bayesian credible interval for a semipartial correlation with a skeptical prior. The skeptical prior distribution is Normal with a mean of 0 and a small standard deviation. A skeptical prior assumes that the population semipartial correlation is within a range of small values (-r to r). If the skeptic is 95% confident that the population correlation is between -r and r, then the prior standard deviation can be set to r/1.96. A semipartial correlation that is less than .2 in absolute value is typically considered to be "small", and the prior standard deviation could then be set to .2/1.96 = .1. A semipartial correlation value that is considered to be small will depend on the application. This function requires the standard error of the estimated semipartial correlation which can be obtained from the ci.spcor function.

Usage

ci.bayes.spcor(alpha, prior_sd, cor, se)

Arguments

alpha

alpha level for 1-alpha credibility interval

prior_sd

standard deviation of skeptical prior distribution

cor

estimated semipartial partial correlation

se

standard error of estimated semipartial correlation

Value

Returns a 1-row matrix. The columns are:

  • Posterior mean - posterior mean (Bayesian estimate of correlation)

  • LL - lower limit of the credible interval

  • UL - upper limit of the credible interval

Examples

ci.bayes.spcor(.05, .1, .582, .137)

# Should return:
#  Posterior mean        LL        UL
#       0.2272797 0.07288039 0.3710398



statpsych documentation built on April 4, 2025, 3:20 a.m.