Chapter Contents

Previous

Next
The CORR Procedure

PROC CORR Statement


PROC CORR <option(s)>;

To do this Use this option
Specify the input data set DATA=
Create output data sets

Specify an output data set to contain Hoeffding's D statistics OUTH=

Specify an output data set to contain Kendall correlations OUTK=

Specify an output data set to contain Pearson correlations OUTP=

Specify an output data set to contain Spearman correlations OUTS=
Control statistical analysis

Exclude observations with nonpositive weight values from the analysis EXCLNPWGT

Request Hoeffding's measure of dependence, D HOEFFDING

Request Kendall's tau-b KENDALL

Request Pearson product-moment correlation PEARSON

Request Spearman rank-order correlation SPEARMAN
Control Pearson correlation statistics

Compute Cronbach's coefficient alpha ALPHA

Compute covariances COV

Compute corrected sums of squares and crossproducts CSSCP

Exclude missing values NOMISS

Specify singularity criterion SINGULAR=

Compute sums of squares and crossproducts SSCP

Specify the divisor for variance calculations VARDEF=
Control printed output

Specify the number and order of correlation coefficients BEST=

Suppress Pearson correlations NOCORR

Suppress all printed output NOPRINT

Suppress significance probabilities NOPROB

Suppress descriptive statistics NOSIMPLE

Change the order of correlation coefficients RANK


Options

ALPHA
calculates and prints Cronbach's coefficient alpha. PROC CORR computes separate coefficients using raw and standardized values (scaling the variables to a unit variance of 1). For each VAR statement variable, PROC CORR computes the correlation between the variable and the total of the remaining variables. It also computes Cronbach's coefficient alpha using only the remaining variables.
Main discussion: Cronbach's Coefficient Alpha
Restriction: If you use a WITH statement, ALPHA is invalid.
Interaction: ALPHA invokes PEARSON.
Interaction: If you specify OUTP=, the output data set also contains six observations with Cronbach's coefficient alpha.
Interaction: When you use the PARTIAL statement, PROC CORR calculates Cronbach's coefficient alpha for partialled variables.
See also: OUTP= option
Featured in: Computing Cronbach's Coefficient Alpha

BEST=n
prints n correlation coefficients for each variable. Correlations are ordered from highest to lowest in absolute value. Otherwise, PROC CORR prints correlations in a rectangular table using the variable names as row and column labels.
Interaction: When you specify HOEFFDING, PROC CORR prints the D statistics in order from highest to lowest.
Range: 1 to the maximum number of variables

COV
calculates and prints covariances.
Interaction: COV invokes PEARSON.
Interaction: If you specify OUTP=, the output data set contains the covariance matrix and the _TYPE_ variable value is COV.
Interaction: When you use the PARTIAL statement, PROC CORR computes a partial covariance matrix.
See also: OUTP= option
Featured in: Computing Rectangular Correlation Statistics with Missing Data and Storing Partial Correlations in an Output Data Set

CSSCP
prints the corrected sums of squares and crossproducts.
Interaction: CSSCP invokes PEARSON.
Interaction: If you specify OUTP=, the output data set contains a CSSCP matrix and the _TYPE_ variable value is CSSCP. If you use a PARTIAL statement, the output data set contains a partial CSSCP matrix.
Interaction: When you use a PARTIAL statement, PROC CORR prints both an unpartial and a partial CSSCP matrix.
See also: OUTP= option

DATA=SAS-data-set
specifies the input SAS data set.
Main discussion: Input Data Sets

EXCLNPWGT
excludes observations with nonpositive weight values (zero or negative) from the analysis. By default, PROC CORR treats observations with negative weights like those with zero weights and counts them in the total number of observations.
Requirement: You must use a WEIGHT statement.
See also: WEIGHT Statement

HOEFFDING
calculates and prints Hoeffding's D statistics. This D statistic is 30 times larger than the usual definition and scales the range between -0.5 and 1 so that only large positive values indicate dependence.
Main discussion: Hoeffding's Measure of Dependence, D
Restriction: When you use a WEIGHT or PARTIAL statement, HOEFFDING is invalid.
Featured in: Computing Pearson Correlations and Other Measures of Association

KENDALL
calculates and prints Kendall tau-b coefficients based on the number of concordant and discordant pairs of observations. Kendall's tau-b ranges from -1 to 1.
Main discussion: Kendall's tau-b
Restriction: When you use a WEIGHT statement, KENDALL is invalid.
Interactions: When you use a PARTIAL statement, probability values for Kendall's partial tau-b are not available.
Featured in: Storing Partial Correlations in an Output Data Set

NOCORR
suppresses calculating and printing of Pearson correlations.
Interaction: If you specify OUTP=, the data set type remains CORR. To change the data set type to COV, CSSCP, or SSCP, use the TYPE= data set option.
See also: Output Data Sets
Featured in: Computing Cronbach's Coefficient Alpha

NOMISS
excludes observations with missing values from the analysis. Otherwise, PROC CORR computes correlation statistics using all the nonmissing pairs of variables.
Main discussion: Missing Values
Tip: Using NOMISS is computationally more efficient.
Featured in: Computing Cronbach's Coefficient Alpha

NOPRINT
suppresses all printed output.
Tip: Use NOPRINT when you want to create an output data set only.

NOPROB
suppresses printing the probabilities associated with each correlation coefficient.

NOSIMPLE
suppresses printing simple descriptive statistics for each variable. However, if you request an output data set, the output data set still contains simple descriptive statistics for the variables.
Featured in: Computing Rectangular Correlation Statistics with Missing Data

OUTH=output-data-set
creates an output data set containing Hoeffding's D statistics. The contents of the output data set are similar to the OUTP= data set.
Main discussion: Output Data Sets
Interaction: OUTH= invokes HOEFFDING.

OUTK=output-data-set
creates an output data set containing Kendall correlation statistics. The contents of the output data set are similar to the OUTP= data set.
Main discussion: Output Data Sets
Interaction: OUTK= option invokes KENDALL.

OUTP=output-data-set
creates an output data set containing Pearson correlation statistics. This data set also includes means, standard deviations, and the number of observations. The value of the _TYPE_ variable is CORR.
Main discussion: Output Data Sets
Interaction: OUTP= invokes PEARSON.
Interaction: If you specify ALPHA, the output data set also contains six observations with Cronbach's coefficient alpha.
Featured in: Storing Partial Correlations in an Output Data Set

OUTS=SAS-data-set
creates an output data set containing Spearman correlation statistics. The contents of the output data set are similar to the OUTP= data set.
Main discussion: Output Data Sets
Interaction: OUTS= invokes SPEARMAN.

PEARSON
calculates and prints Pearson product-moment correlations when you use the HOEFFDING, KENDALL, or SPEARMAN option. If you omit the correlation type, PROC CORR automatically produces Pearson correlations. The correlations range from -1 to 1.
Main discussion: Pearson Product-Moment Correlation
Featured in: Computing Pearson Correlations and Other Measures of Association

RANK
prints the correlation coefficients for each variable. Correlations are ordered from highest to lowest in absolute value. Otherwise, PROC CORR prints correlations in a rectangular table using the variable names as row and column labels.
Interaction: If you use HOEFFDING, PROC CORR prints the D statistics in order from highest to lowest.

SINGULAR=p
specifies the criterion for determining the singularity of a variable when you use a PARTIAL statement. A variable is considered singular if its corresponding diagonal element after Cholesky decomposition has a value less than p times the original unpartialled corrected sum of squares of that variable.
Main discussion: Partial Correlation
Default: 1E-8
Range: between 0 and 1

SPEARMAN
calculates and prints Spearman correlation coefficients based on the ranks of the variables. The correlations range from -1 to 1. Computing Pearson Correlations and Other Measures of Association
Main discussion: Spearman Rank-Order Correlation
Restriction: When you specify a WEIGHT statement, SPEARMAN is invalid.
Featured in:

SSCP
prints the sums of squares and crossproducts.
Interaction: SSCP invokes PEARSON.
Interaction: When you specify OUTP=, the output data set contains a SSCP matrix and the _TYPE_ variable value is SSCP. If you use a PARTIAL statement, the output data set does not contain an SSCP matrix.
Interaction: When you use a PARTIAL statement, PROC CORR prints the unpartial SSCP matrix.
Featured in: Computing Rectangular Correlation Statistics with Missing Data

VARDEF=divisor
specifies the divisor to use in the calculation of variances, standard deviations, and covariances.

Possible Values for VARDEF= shows the possible values for divisor and associated divisors where k is the number of PARTIAL statement variables.

Possible Values for VARDEF=
Value Divisor Formula
DF degrees of freedom n - k - 1
N number of observations n
WDF sum of weights minus one ([Sigma]iwi) - k - 1
WEIGHT|WGT sum of weights [Sigma]iwi

The procedure computes the variance as [IMAGE], where [IMAGE] is the corrected sums of squares and equals [IMAGE]. When you weight the analysis variables, [IMAGE] equals [IMAGE], where [IMAGE] is the weighted mean.
Default: DF
Tip: When you use the WEIGHT statement and VARDEF=DF, the variance is an estimate of [IMAGE], where the variance of the ith observation is [IMAGE] and [IMAGE] is the weight for the ith observation. This yields an estimate of the variance of an observation with unit weight.
Tip: When you use the WEIGHT statement and VARDEF=WGT, the computed variance is asymptotically (for large n) an estimate of [IMAGE], where [IMAGE] is the average weight. This yields an asymptotic estimate of the variance of an observation with average weight.
Main discussion: Weighted statistics Example .


Chapter Contents

Previous

Next

Top of Page

Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.