------------------------------------------------------------------------------- help forpwcov-------------------------------------------------------------------------------

Generate pairwise covariances

pwcovvarlist[ifexp] [inrange] [weight] [,save]

Description

pwcovcomputes the pairwise covariances between a number of variables, using the available observations on each pair of variables to generate the sample covariances.fweightsandpweightsare allowed.

Options

saveindicates that four new variables should be created:pw_t,pw_tk,pw_covandpw_N. The first two variables give the row and column indices of the covariance, provided in the third variable, whilepw_Nprovides the number of observations used to compute that covariance. These variables are added to the current data set, and must not already exist.

Examples. webuse grunfeld . reshape wide invest mvalue kstock time , i(year) j(company)

. pwcov invest1 invest2 invest3 invest4 invest5, print save

AuthorChristopher F. Baum, Boston College baum@bc.edu

AcknowledgementsThe development of this routine was inspired by Peter Gottschalk.

Also seeOn-line: pwcorr