biserial.cor {ltm} | R Documentation |
Point-Biserial Correlation
Description
Computes the point-biserial correlation between a dichotomous and a continuous variable.
Usage
biserial.cor(x, y, use = c("all.obs", "complete.obs"), level = 1)
Arguments
x |
a numeric vector representing the continuous variable. |
y |
a factor or a numeric vector (that will be converted to a factor) representing the dichotomous variable. |
use |
If |
level |
which level of |
Details
The point biserial correlation computed by biserial.cor()
is defined as follows
where and
denote the sample means of the
-values
corresponding to the first and second level of
, respectively,
is the sample standard deviation of
, and
is the sample proportion for
. The first level of
is defined by the
level
argument; see Examples.
Value
the (numeric) value of the point-biserial correlation.
Note
Changing the order of the levels for y
will produce a different result. By default, the first level is used
as a reference level
Author(s)
Dimitris Rizopoulos d.rizopoulos@erasmusmc.nl
Examples
# the point-biserial correlation between
# the total score and the first item, using
# '0' as the reference level
biserial.cor(rowSums(LSAT), LSAT[[1]])
# and using '1' as the reference level
biserial.cor(rowSums(LSAT), LSAT[[1]], level = 2)