pbs2bs {CorrToolBox} | R Documentation |
Computation of the Biserial Correlation from the Point-Biserial Correlation
Description
This function computes the biserial correlation between two continuous variables given the correlation after dichotomization of one of the variables (point-biserial correlation) as seen in Demirtas and Hedeker (2016). Before computation of the biserial correlation, the specified point-biserial correlation is compared to the lower and upper correlation bounds of the continuous variable and binary variable using the generate, sort and correlate (GSC) algorithm in Demirtas and Hedeker (2011).
Usage
pbs2bs(pbs, bin.var, cont.var, p=NULL, cutpoint=NULL)
Arguments
pbs |
The point-biserial correlation. |
bin.var |
A numeric vector of the continuous variable before dichotomization. |
cont.var |
A numeric vector of the the continuous variable that is not transformed. |
p |
The expected value of the numeric vector |
cutpoint |
The value at which the vector |
Value
The biserial correlation.
References
Demirtas, H. and Hedeker, D. (2011). A practical way for computing approximate lower and upper correlation bounds. The American Statistician, 65(2), 104-109.
Demirtas, H. and Hedeker, D. (2016). Computing the point-biserial correlation under any underlying continuous distribution. Communications in Statistics-Simulation and Computation, 45(8), 2744-2751.
Examples
set.seed(123)
y1<-rweibull(n=100000, scale=1, shape=1.2)
gaussmix <- function(n,m1,m2,s1,s2,pi) {
I <- runif(n)<pi
rnorm(n,mean=ifelse(I,m1,m2),sd=ifelse(I,s1,s2))
}
y2<-gaussmix(n=100000, m1=0, s1=1, m2=3, s2=1, pi=0.6)
pbs2bs(pbs=0.25, bin.var=y1, cont.var=y2, p=0.55)
pbs2bs(pbs=0.25, bin.var=y1, cont.var=y2, cutpoint=0.65484)