The CORRELATION Procedure

PROC CORRELATION Statement

  • PROC CORRELATION <options>;

The PROC CORRELATION statement invokes the procedure. Table 4.2 summarizes the options available in the PROC CORRELATION statement.

Table 4.2: Summary of PROC CORRELATION Options

Option

Description

Data Tables

DATA=

Specifies the CAS input data table

OUTP=

Specifies the CAS output data table to contain the Pearson correlation statistics

Statistical Analysis

EXCLNPWGT

Excludes observations that have nonpositive weight values from the analysis

NOMISS

Excludes observations that have missing analysis values from the analysis

Statistics

ALPHA

Computes Cronbach’s coefficient alpha

COV

Computes covariances

CSSCP

Computes corrected sums of squares and crossproducts

SSCP

Computes sums of squares and crossproducts

VARDEF=

Specifies the divisor for variance calculations

Printed Output

BEST=

Displays the specified number of ordered correlation coefficients

NOCORR

Suppresses Pearson correlations

NOPROB

Suppresses p-values

NOSIMPLE

Suppresses descriptive statistics

RANK

Displays ordered correlation coefficients


ALPHA

calculates and prints Cronbach’s coefficient alpha. PROC CORRELATION computes separate coefficients by using raw and standardized values (scaling the variables to a unit variance of 1). For each analysis variable, PROC CORRELATION computes the correlation between that variable and all the remaining variables. It also computes Cronbach’s coefficient alpha by using only the remaining variables.

When you specify this option, the Pearson correlations are also displayed. If you also specify the OUTP= option, the output data table also contains observations that have Cronbach’s coefficient alpha. For more information about Cronbach’s coefficient alpha, see the section Cronbach’s Coefficient Alpha.

This option is not valid if a WITH statement is specified.

BEST=n

prints the n highest correlation coefficients for each variable, where n . Correlations are ordered from highest to lowest in absolute value. (If you do not specify this option, PROC CORRELATION prints correlations in a rectangular table, using the variable names as row and column labels.)

COV

displays the variance and covariance matrix. When you specify this option, the Pearson correlations are also displayed. If you also specify the OUTP= option, the output data table also contains the covariance matrix with the corresponding _TYPE_ variable value 'COV.'

CSSCP

displays a table of the corrected sums of squares and crossproducts. When you specify this option, the Pearson correlations are also displayed. If you also specify the OUTP= option, the output data table also contains a CSSCP matrix with the corresponding _TYPE_ variable value 'CSSCP.'

DATA=CAS-libref.data-table

names the input data table for PROC CORRELATION to use. The default is the most recently created data table. CAS-libref.data-table is a two-level name, where

CAS-libref

refers to a collection of information that is defined in the LIBNAME statement and includes the caslib, which includes a path to the data, and a session identifier, which defaults to the active session but which can be explicitly defined in the LIBNAME statement. For more information about CAS-libref, see the section Using CAS Sessions and CAS Engine Librefs.

data-table

specifies the name of the input data table.

EXCLNPWGT
EXCLNPWGTS

excludes observations that have nonpositive weight values from the analysis. (By default, PROC CORRELATION treats observations that have negative weights like those observations that have zero weights and counts them in the total number of observations.)

NOCORR

suppresses display of Pearson correlations.

NOMISS

excludes observations that have missing values from the analysis. (If you do not specify this option, PROC CORRELATION computes correlation statistics by using all the nonmissing pairs of variables.)

NOPROB

suppresses display of the probabilities that are associated with each correlation coefficient.

NOSIMPLE

suppresses printing of simple descriptive statistics for each variable. However, if you request an output data table, the output data table still contains simple descriptive statistics for the variables.

OUTP=CAS-libref.data-table

creates an output data table that contains Pearson correlation statistics. CAS-libref.data-table is a two-level name, where

CAS-libref

refers to a collection of information that is defined in the LIBNAME statement and includes the caslib, which includes a path to where the data table is to be stored, and a session identifier, which defaults to the active session but which can be explicitly defined in the LIBNAME statement. For more information about CAS-libref, see the section Using CAS Sessions and CAS Engine Librefs.

data-table

specifies the name of the output data table.

This data table also includes means, standard deviations, and the number of observations. If you also specify the ALPHA option, the output data table also contains six observations that have Cronbach’s coefficient alpha.

RANK

displays the ordered correlation coefficients for each variable. Correlations are ordered from highest to lowest in absolute value.

SSCP

displays a table of the sums of squares and crossproducts. When you specify this option, the Pearson correlations are also displayed. If you also specify the OUTP= option, the output data table contains an SSCP matrix and the corresponding _TYPE_ variable value is 'SSCP.'

VARDEF=DF | N | WDF | WEIGHT | WGT

specifies the variance divisor in the calculation of variances and covariances. The default is VARDEF=DF.

Table 4.3 displays available values and associated divisors for the VARDEF= option, where n is the number of nonmissing observations and is the weight associated with the jth nonmissing observation.

Table 4.3: Possible Values for the VARDEF= Option

Value

Description

Divisor

DF

Degrees of freedom

n – 1

N

Number of observations

n

WDF

Sum of weights minus one

WEIGHT | WGT

Sum of weights


Last updated: December 21, 2018