Stata
Products Purchase Support Company
Search
   >> Home >> Resources & support >> FAQs >> Obtaining the correlation matrix

How can I obtain the correlation matrix as a Stata matrix?

Title   Obtaining the correlation matrix
Author William Gould, StataCorp
Date December 1999

The correlate command will report the correlation matrix of the data, but there are occasions when you need the matrix stored as a Stata matrix so you can further manipulate it. You can obtain it by typing

        . matrix accum R = varlist, nocons dev
        . matrix R = corr(R)

The first line places the cross-product matrix of the data in R. The second line converts that to a correlation matrix.

FAQs
What's new?
Statistics
Data management
Graphics
Programming Stata
Mata
Resources
Internet capabilities
Stata for Windows
Stata for Unix
Stata for Macintosh
Technical support
Resources & support
FAQs
Technical support
NetCourses
Short courses
Users Group meetings
Statalist
Links
Software updates
Software archives
Customer service
Manuals & supplements
Stata Journal
STB
Stata News
Stata Automation
Plugins

Site overview
Products
Resources & support
Company
Site index

© Copyright 1996–2008 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index