{smcl}
{* 14jan2004}{...}
{hline}
help for {hi:corrmat}
{hline}

{title:Create correlation or covariance matrices}

{p 8 14}{cmd:corrmat} {it:varlist} [{it:weight}] 
	[{cmd:,} {c -(}{cmd:corrmat} | 
		 {cmdab:cor:rmat(}{it:matname}{cmd:)}{c )-}
	         {c -(}{cmd:covmat} | 
		 {cmdab:cov:mat(}{it:matname}{cmd:)}{c )-}]
		 [{cmd:nomat}]
		 
		 
{p 4 4 2}
{cmd:aweight}s and {cmd:fweight}s are allowed; see help {help weights}.


{title:Description}

{p 4 4 2}
{cmd:corrmat} will create and save a correlation matrix, covariance matrix,
or both.  To access these matrices, after the {cmd:corrmat} command, type
{cmd:return list}, {cmd:matrix dir}, or both, depending on the options 
specified..


{title:Options}

{p 4 8 2}{cmd:corrmat} produces and saves a correlation matrix.  This matrix will
be stored in the {cmd:return list} only.  This matrix is the equivalent of
typing "{cmd:correlate} {it:varlist}".

{p 4 8 2}{cmd:corrmat(}{it:matname}{cmd:)} produces and saves a correlation 
matrix.  This matrix will be stored in the {cmd:return list} as well as 
{cmd:matrix dir}.  This matrix is the equivalent of typing 
"{cmd:correlate} {it:varlist}".

{p 4 8 2}{cmd:covmat} produces and saves a covariance matrix.  This matrix will
be stored in the {cmd:return list} only.  This matrix is the equivalent of
typing "{cmd:correlate} {it:varlist} {cmd:, covariance}".

{p 4 8 2}{cmd:covmat(}{it:matname}{cmd:)} produces and saves a covariance 
matrix.  This matrix will be stored in the {cmd:return list} as well as 
{cmd:matrix dir}.  This matrix is the equivalent of typing 
"{cmd:correlate} {it:varlist} {cmd:, covariance}".

{p 4 8 2}{cmd:nomat} with no other options produces a correlation matrix but 
does not save the matrix in {cmd:return list} or {cmd:matrix dir}.  If used 
with the {cmd:covmat} or {cmd:covmat()} option, a covariance matrix is 
displayed, but not saved anywhere.


{title:Author}

{p 8}Shannon Driver, Stata Corporation{p_end}
{p 8}srd@stata.com{p_end}


{title:Examples}

{p 8 12}{inp:. corrmat price weight mpg}

{p 8 12}{inp:. corrmat price weight mpg, corrmat}

{p 8 12}{inp:. corrmat price weight mpg, corrmat(A)}

{p 8 12}{inp:. corrmat price weight mpg, covmat}

{p 8 12}{inp:. corrmat price weight mpg, covmat(B)}

{p 8 12}{inp:. corrmat price weight mpg, corrmat covmat}

{p 8 12}{inp:. corrmat price weight mpg, corrmat(A) covmat(B)}

{p 8 12}{inp:. corrmat price weight mpg, nomat}

{p 8 12}{inp:. corrmat price weight mpg, covmat nomat}


{title:Also see}

{p 0 19}On-line:  help for {help correlate}, {help mataccum}, {help matrix},
{help return}{p_end}
