cor.test: Estimate the correlation parameter of a bi-variate normal

View source: R/functions.R

cor.testR Documentation

Estimate the correlation parameter of a bi-variate normal

Description

This function estimates the rho parameter for bivariate normal using MCMC. It use a very wide prior on the mean (normal) and sd (uniform) for the marginals.

Usage

cor.test(x,y,method = "mcmc")

Arguments

x, y

numeric vectors of data values. 'x' and 'y' must have the same length

Details

It is used in the same way at the base cor.test function except with settting method to "mcmc"

Examples

## Hollander & Wolfe (1973), p. 187f.
## Assessment of tuna quality.  We compare the Hunter L measure of
##  lightness to the averages of consumer panel scores (recoded as
##  integer values from 1 to 6 and averaged over 80 such values) in
##  9 lots of canned tuna.
x <- c(44.4, 45.9, 41.9, 53.3, 44.7, 44.1, 50.7, 45.2, 60.1)
y <- c( 2.6,  3.1,  2.5,  5.0,  3.6,  4.0,  5.2,  2.8,  3.8)
##  The alternative hypothesis of interest is that the
##  Hunter L value is positively associated with the panel score.
cor.test(x, y, method = "mcmc")

ljcolling/bayesCorr documentation built on Feb. 15, 2023, 3:14 a.m.