Sample 24991: Compute biserial, point biserial, and rank biserial correlations
Compute biserial, point biserial, and rank biserial correlations
- PURPOSE:
-
Computes biserial, point biserial, and rank biserial correlations between a binary and a continuous (or ranked) variable.
- REQUIREMENTS:
-
Base SAS Software.
- USAGE:
-
Follow the instructions in the Downloads tab of this
sample to save the %BISERIAL macro definition. Replace the text within quotes in the following statement with the location of the %BISERIAL macro definition file on your system. In your SAS program or in the SAS editor window, specify this statement to define the %BISERIAL macro and make it available for use:
%inc "<location of your file containing the BISERIAL macro>";
Following this statement, you may call the %BISERIAL macro. See the Results tab for an example.
The required arguments for the %BISERIAL macro are as follows:
-
data=
-
SAS data set to be analyzed.
-
binary=
-
Name of dichotomous variable which must be numeric with values 0 and 1.
-
contin=
-
Name of continuous variable. Ranks of this variable will be computed to produce the rank biserial correlation.
-
out=
-
Output data set name.
- DETAILS:
-
The biserial correlation measures the strength of the relationship between a binary and a continuous variable, where the binary variable has an underlying continuous distribution but is measured as binary. If the binary variable is truly dichotomous, then the point biserial correlation is used. The rank biserial correlation measures the strength of the relationship between a binary and a rankings (ordinal) variable.
The %BISERIAL macro produces only an output data set.
- LIMITATIONS:
-
No error checking is done. Be sure that data set and variable names
exist and are properly spelled, and that the BINARY= variable only takes on values 0 and 1.
- MISSING VALUES:
-
Observations with missing values of the binary or the continuous variable are excluded.
- REFERENCES:
-
Helena Chmura Kraemer, 1982, "Biserial Correlation", Encyclopaedia of
Statistical Sciences, Volume 1, Wiley, pages 276-279.
These sample files and code examples are provided by SAS Institute
Inc. "as is" without warranty of any kind, either express or implied, including
but not limited to the implied warranties of merchantability and fitness for a
particular purpose. Recipients acknowledge and agree that SAS Institute shall
not be liable for any damages whatsoever arising out of their use of this material.
In addition, SAS Institute will provide no support for the materials contained herein.
These sample files and code examples are provided by SAS Institute
Inc. "as is" without warranty of any kind, either express or implied, including
but not limited to the implied warranties of merchantability and fitness for a
particular purpose. Recipients acknowledge and agree that SAS Institute shall
not be liable for any damages whatsoever arising out of their use of this material.
In addition, SAS Institute will provide no support for the materials contained herein.
- EXAMPLE:
- In the following statements, correlations are computed between the binary variable, X1, and the continuous variable LENGTH. Since X1 does not have values 0 and 1, the variable EVENT is created and used in the %BISERIAL macro. The data set OUT1 contains the correlations.
data k;
length x1 $ 1;
input x1 length;
event=(x1='y');
cards;
y 14.8
n 13.8
y 12.4
y 10.1
y 7.1
y 6.1
n 5.8
y 4.6
n 4.3
n 3.5
n 3.3
y 3.2
y 3.0
n 2.8
n 2.8
n 2.5
y 2.4
y 2.3
y 2.1
n 1.7
n 1.7
n 1.5
n 1.3
n 1.3
n 1.2
n 1.2
n 1.1
y 0.8
n 0.7
n 0.6
n 0.5
n 0.2
n 0.2
y 0.1
;
/* Define the BISERIAL macro */
%inc "<location of your file containing the BISERIAL macro>";
%biserial(data=k, contin=LENGTH, binary=EVENT, out=out1);
proc print data=out1 label noobs;
title 'Point Biserial, Biserial and Rank Biserial Correlations';
run;
- RESULTS:
-
Point Biserial, Biserial and Rank Biserial Correlations
Point Rank
Biserial Biserial Biserial
Corr Corr Corr
0.36149 0.45369 0.43590
Right-click on the link below and select Save to save
the %BISERIAL macro definition
to a file. It is recommended that you name the file
biserial.sas
.
Download and save biserial.sas
Computes biserial, point biserial, and rank biserial correlations between a binary and a continuous (or ranked) variable.
Type: | Sample |
Topic: | SAS Reference ==> Procedures ==> RANK Analytics ==> Nonparametric Analysis Analytics ==> Descriptive Statistics SAS Reference ==> Procedures ==> CORR Analytics ==> Categorical Data Analysis Analytics ==> Transformations
|
Date Modified: | 2007-08-11 03:03:08 |
Date Created: | 2005-01-13 15:02:57 |
Operating System and Release Information
SAS System | SAS/STAT | All | n/a | n/a |
SAS System | Base SAS | All | n/a | n/a |