Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: st: Table of partial correlation coefficients


From   Richard Williams <[email protected]>
To   [email protected]
Subject   Re: st: Table of partial correlation coefficients
Date   Fri, 11 Mar 2011 11:31:27 -0500

At 10:38 AM 3/11/2011, Charles Koss wrote:
Richard, thank you for following up. Based on your code, I would like
to summarize the results from pcorr. Let's say I run:

webuse auto
pcorr price  mpg trunk weight length
pcorr mpg price   trunk weight length
pcorr trunk price  mpg  weight length
pcorr weight price  mpg trunk  length
pcorr length price  mpg trunk weight

Then, I would like to make a summary of the results from the previous
5 lines of code. I know I can copy & paste but imagine how easy would
it be to obtain a table resembling the corr command output.

OK, so by one variable, you meant one dependent variable. How about something like this? You'll need to get estadd and esttab from SSC first.

webuse auto, clear
reg price  mpg trunk weight length
estadd pcorr
est store m1
reg mpg price   trunk weight length
estadd pcorr
est store m2
reg trunk price  mpg  weight length
estadd pcorr
est store m3
reg weight price  mpg trunk  length
estadd pcorr
est store m4
reg length price  mpg trunk weight
estadd pcorr
est store m5
esttab m1 m2 m3 m4 m5, main(pcorr) not noconstant nostar

The output from the last command is

. esttab m1 m2 m3 m4 m5, main(pcorr) not noconstant nostar

-----------------------------------------------------------------------------
                      (1)          (2)          (3)          (4)          (5)
                    price          mpg        trunk       weight       length
-----------------------------------------------------------------------------
mpg                -0.122                   -0.0240       -0.202       -0.174
trunk              0.0317      -0.0240                   -0.0797        0.363
weight              0.409       -0.202      -0.0797                     0.830
length             -0.292       -0.174        0.363        0.830
price                           -0.122       0.0317        0.409       -0.292
-----------------------------------------------------------------------------
N                      74           74           74           74           74
-----------------------------------------------------------------------------
pcorr coefficients




-------------------------------------------
Richard Williams, Notre Dame Dept of Sociology
OFFICE: (574)631-6668, (574)631-6463
HOME:   (574)289-5227
EMAIL:  [email protected]
WWW:    http://www.nd.edu/~rwilliam

*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index