Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down at the end of May, and its replacement, statalist.org is already up and running.


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

Re: st: Cohen's f2 on a regression


From   Richard Williams <richardwilliams.ndu@gmail.com>
To   statalist@hsphsun2.harvard.edu, statalist@hsphsun2.harvard.edu
Subject   Re: st: Cohen's f2 on a regression
Date   Mon, 01 Aug 2011 18:54:23 -0500

At 05:15 PM 8/1/2011, Linh Vuong wrote:
Statalist,

Does anyone know the command to get Cohen's f (effect size estimator
R2/(1-R2) ) for an entire regression?  I see the help topic for
regeffectsize and effectsize but I'd like to get Cohen's f for the
entire regression, not just for specific variables.

Thanks,
Linh

Is that literally the formula? If so, how about something like

. sysuse auto
(1978 Automobile Data)

. reg price weight length foreign

      Source |       SS       df       MS              Number of obs =      74
-------------+------------------------------           F(  3,    70) =   28.39
       Model |   348565467     3   116188489           Prob > F      =  0.0000
    Residual |   286499930    70  4092856.14           R-squared     =  0.5489
-------------+------------------------------           Adj R-squared =  0.5295
       Total |   635065396    73  8699525.97           Root MSE      =  2023.1

------------------------------------------------------------------------------
       price |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
      weight |   5.774712   .9594168     6.02   0.000     3.861215    7.688208
      length |  -91.37083   32.82833    -2.78   0.007    -156.8449   -25.89679
     foreign |   3573.092    639.328     5.59   0.000     2297.992    4848.191
       _cons |   4838.021    3742.01     1.29   0.200    -2625.183    12301.22
------------------------------------------------------------------------------

. di "Cohen's F = " =e(r2) / (1-e(r2))
Cohen's F = 1.2166337



-------------------------------------------
Richard Williams, Notre Dame Dept of Sociology
OFFICE: (574)631-6668, (574)631-6463
HOME:   (574)289-5227
EMAIL:  Richard.A.Williams.5@ND.Edu
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–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index