Statalist The Stata Listserver


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: RE: on-line resources for multiple partial F-test?


From   "Nick Cox" <n.j.cox@durham.ac.uk>
To   <statalist@hsphsun2.harvard.edu>
Subject   st: RE: on-line resources for multiple partial F-test?
Date   Mon, 30 Jan 2006 13:01:14 -0000

Asking for help with specific homework questions is
deprecated, as you should have seen in reading the
Statalist FAQ, but this seems rather different.
An FAQ cited there is

http://www.catb.org/~esr/faqs/smart-questions.html#homework

which says:

"Don't post homework questions

Hackers are good at spotting homework questions;
most of us have done them ourselves. Those questions
are for you to work out, so that you will learn from
the experience. It is OK to ask for hints, but not
for entire solutions."

In your case, it seems that you are being expected to learn
to walk and to run at the same time!

More concretely, a basic regression on a binary predictor
is equivalent to a t-test. Compare these results:

. sysuse auto
(1978 Automobile Data)

. ttest mpg, by(foreign)

Two-sample t test with equal variances
------------------------------------------------------------------------------
    Group |     Obs        Mean    Std. Err.   Std. Dev.   [95% Conf. Interval]
---------+--------------------------------------------------------------------
Domestic |      52    19.82692     .657777    4.743297    18.50638    21.14747
  Foreign |      22    24.77273     1.40951    6.611187    21.84149    27.70396
---------+--------------------------------------------------------------------
combined |      74     21.2973    .6725511    5.785503     19.9569    22.63769
---------+--------------------------------------------------------------------
     diff |           -4.945804    1.362162               -7.661225   -2.230384
------------------------------------------------------------------------------
     diff = mean(Domestic) - mean(Foreign)                         t =  -3.6308
Ho: diff = 0                                     degrees of freedom =       72

     Ha: diff < 0                 Ha: diff != 0                 Ha: diff > 0
  Pr(T < t) = 0.0003         Pr(|T| > |t|) = 0.0005          Pr(T > t) = 0.9997

. regress mpg foreign

       Source |       SS       df       MS              Number of obs =      74
-------------+------------------------------           F(  1,    72) =   13.18
        Model |  378.153515     1  378.153515           Prob > F      =  0.0005
     Residual |  2065.30594    72  28.6848048           R-squared     =  0.1548
-------------+------------------------------           Adj R-squared =  0.1430
        Total |  2443.45946    73  33.4720474           Root MSE      =  5.3558

------------------------------------------------------------------------------
          mpg |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
      foreign |   4.945804   1.362162     3.63   0.001     2.230384    7.661225
        _cons |   19.82692   .7427186    26.70   0.000     18.34634    21.30751
------------------------------------------------------------------------------

Also,

. scatter mpg foreign || lfit mpg foreign

shows graphically what you just did and help you think about R^2.

My other advice is to think in terms of good textbooks
first, not on-line resources.

Nick
n.j.cox@durham.ac.uk

Doug Mounce

> Any recommendations for a good on-line description and explanation
> for applying the multiple partial F-test?  Also, what's the general
> way to think about using regress when the Y variable is continuous,
> but the X is binary?
>
> We've been learning in class how to describe the regress of one
> continuous variable on another, and I understand how to do a log
> transform and look for curvature or heteroscedasticity.  We do
> jackknife residuals and some other diagnostics, and I'm stumped on
> how to describe the regress when the independent variable is
> binary.
> I can talk about the regression coefficient, I guess, but the R^2
> doesn't account-for much variation in this data.
>
> Sorry if asking for help with homework is bad form, but I'm
> also have
> a lot of clinical data that's binary and I thought that regression
> was pretty limited there.  I'm an adult student with a job
> and family
> so finding a study group has been tough; any consideration of this
> request will be greatly appreciated

*
*   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–2021 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index