help cpspear

Title

cpspear -- Spearman correlations for each row vs each column variable

Syntax

cpspear
rowvarlist
\
colvarlist
[if] [in]
[
,
square
matrix(matname)
matlist_options
]

cpspear
varlist
[if] [in]
[
,
square
matrix(matname)
matlist_options
]

Description

cpspear produces a matrix of Spearman correlations for
rowvarlist versus colvarlist (first syntax) or for
varlist (second syntax). With the first syntax, the matrix may thus
be oblong, and need not be square. With the second syntax, the matrix is
square.

The stub cp is derived from Cartesian product; it may also be
interpreted as "cross pairs".

The backslash \ must be used to separate the rowvarlist and
the colvarlist in the first syntax.

Options

square specifies squaring of correlations.

matrix(matname) specifies that the correlation matrix produced be
saved as matrix matname.

matlist_options are options of matrix list. The default
includes format(%5.4f).

Examples

. sysuse auto, clear

. cpspear mpg-foreign \ price

. cpspear mpg-foreign, f(%4.2f)

Author

Nicholas J. Cox, Durham University, U.K.

n.j.cox@durham.ac.uk

Saved results

r(N) number of observations
r(Rho) matrix of correlations
r(p) matrix of P-values

Also see

Official commands:

[R] spearman Spearman correlations

[G-2] graph matrix Scatter plot
matrices

User-written commands (if installed):

cpcorr Correlations for row and column variables

crossplot Twoway plots for each y vs each x variable