*! version 1.0.0 11july2016

pwcorrf

pwcorrf -- Faster version of pwcorr, with builtin reshape option

Syntax

pwcorrf
varlist
[, reshape full showt]

Main
reshape calculates correlations of a single variable across panel groups

full forces full display of the correlation matrix

showt displays the number of joint observations per pair

Description

pwcorrf calculates the pairwise correlations across varlist. It returns the same results as pwcorr. Specifying the reshape option allows you to calculate correlations of a single variable across panel units.

Options

Main

reshape reshapes your data wide, such that the correlation calculated is across panel groups, rather than across variables. Your data will be unaffected.

full forces the program to show the full correlation matrix after execution. The default is to show the first 6x6 matrix of correlations.

showt forces the program to show the matrix of the number of joint observations per pair. This matrix can always be assessed by calling r(T).

Remarks

Remarks

For detailed information on the original command, see pwcorr. pwcorrf is (usually) faster, but can only calculate the Pearson correlation.

The interpretation of the correlations calculated using reshape depends on the sort of data used. E.g. if your panel units are countries, they are spatial correlations.

Any mistakes are my own.

Examples

. pwcorrf mpg weight

. pwcorrf mpg weight, full

. xtset county quarter

. pwcorrf gdp, reshape

Stored results

pwcorrf stores the following in r():

Matrices

r(C) correlation matrix

r(T) number of joint observations per pair

Author

Jesse Wursten
Faculty of Economics and Business
KU Leuven
jesse.wursten@kuleuven.be