Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: RE: RE: Partial R-squares


From   "Nichols, Austin" <[email protected]>
To   "'[email protected]'" <[email protected]>
Subject   st: RE: RE: Partial R-squares
Date   Tue, 14 Sep 2004 12:45:21 -0400

See also -ivreg2- 
(net from http://www.stata-journal.com/software/sj4-2, net describe
st0030_1) 
if you are interested in the partial R^2 of instruments in first stage of
IV.

It uses the following code:
* 1st stage regression without excluded exogenous
        capture ivreg2 ``i'' `inexog' `weight' /*
            */ if `touse', `nocons' `robust' `clopt' `bwopt' `kernopt' small
        scalar `rssinc'=e(rss)
* NB: uncentered R2 for main regression is 1-rssall/yy; for restricted is
1-rssinc/yy;
*     squared semipartial correlation=(rssinc-rssall)/yy=diff of 2 R2s
* Squared partial correlation (="partialled-out R2")
        scalar `pr2'=(`rssinc'-`rssall')/`rssinc'
        if "`ffirst'" == "" {
di in gr "Partial R-squared of excluded instruments: " _c
di in ye %8.4f `pr2'

-----Original Message-----
From: Yulia Marchenko [mailto:[email protected]]
Sent: Tuesday, September 14, 2004 12:32 PM
To: [email protected]
Subject: st: RE: Partial R-squares


Jillian wrote:

>In doing regression analysis, is it possible for the output to show the
partial R-squares to determine how much
>each variable contributes to the explained variance?

You can use -pcorr2- command to get a table of coefficients of partial
determination:

 . net describe pcorr2, from(http://fmwww.bc.edu/RePEc/bocode/p)

 Example:

 . sysuse auto, clear
 . pcorr2 mpg weight length

--------------------------------------------------------------------------
. sysuse auto, clear
(1978 Automobile Data)

. pcorr2 mpg weight length

(obs=74)

Partial and Semipartial correlations of mpg with

    Variable |     Partial      SemiP    Partial^2     SemiP^2       Sig.
-------------+------------------------------------------------------------
      weight |     -0.2769     -0.1677      0.0767      0.0281       0.018
      length |     -0.1682     -0.0993      0.0283      0.0099       0.155

--Yulia
[email protected]






*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/
*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



© Copyright 1996–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index