biserial.cor: Biserial Correlation

Description Usage Arguments Details Value References Examples

View source: R/exploratory.R

Description

Point-Biserial correlation coefficient is a correlation coefficient used when one variable is continuous and the other variable is dichotomous.

Usage

1
biserial.cor(x, y, use = c("all.obs", "complete.obs"), level = 1)

Arguments

x

a numeric vector representing the continuous variable.

y

a numeric vector representing the dichotomous variable.

use

Is a option for the use of missing values.

level

which level of y to use.

Details

It is calculated by applying the Pearson correlation coefficient to the case where one of the variables has dichotomous nature. It is calculated as

r_{xy} = (\bar{x}_p - \bar{x}_q / S_x)*√{pq}

where p is the proportion of subjects with one of the two possible values of the variable Y, q is the proportion of subjects with the other possible value,

\bar{x}_p

and

\bar{x}_q

is the average X subjects whose proportion is p and q respectively, and $S_x$ is the standard deviation of all subjects X. This function was adapted from ltm_1.0 package.

Value

The value of the point-biserial correlation.

References

U.Olsson, F.Drasgow, and N.Dorans (1982). The polyserial correlation coefficient. Psychometrika, 47:337-347.

Cox. N.R. (1974). Estimation of the Correlation between a Continuous and a Discrete Variable. Biometrics, 30:171-178.

Examples

1
2
data <- simulateTest(model="2PL",items=10,individuals=1000)
biserial.cor(rowSums(data$test), data$test[,1])

Example output

[1] -0.399795

IRTpp documentation built on May 29, 2017, 9:58 a.m.