UCLA Academic Technology Services HomeServicesClassesContactJobs
Search

Stata Textbook Examples
Design and Analysis by Geoffrey Keppel
Chapter 3: Variance Estimates and Evaluation of the F Ratio

Page 59 of Keppel illustrates a one way analysis of variance. This example compares the number of errors (failures) for four different treatment groups who differed in their level of sleep deprivation (indicated by the variable a). The analysis is shown below using the xi3 command. You can download the xi3 command by typing findit xi3 (see How can I use the findit command to search for programs and get additional help? for more information about using findit).
use http://www.ats.ucla.edu/stat/stata/examples/da/chap3, clear
xi3: regress failures g.a
g.a               _Ia_1-4             (naturally coded; _Ia_1 omitted)

      Source |       SS       df       MS              Number of obs =      16
-------------+------------------------------           F(  3,    12) =    7.34
       Model |     3314.25     3     1104.75           Prob > F      =  0.0047
    Residual |      1805.5    12  150.458333           R-squared     =  0.6473
-------------+------------------------------           Adj R-squared =  0.5592
       Total |     5119.75    15  341.316667           Root MSE      =  12.266

------------------------------------------------------------------------------
    failures |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
       _Ia_2 |      11.25   8.673475     1.30   0.219    -7.647878    30.14788
       _Ia_3 |         31   8.673475     3.57   0.004     12.10212    49.89788
       _Ia_4 |      35.25   8.673475     4.06   0.002     16.35212    54.14788
       _cons |     45.875   3.066536    14.96   0.000     39.19359    52.55641
------------------------------------------------------------------------------
Because a has four levels, it has three degrees of freedom and the xi3 command created three terms to go along with these three degrees of freedom, _Ia_2, _Ia_3, and _Ia_4. We can use the test to get the overall test of the main effect of a, as shown below.
test  _Ia_2 _Ia_3 _Ia_4

 ( 1)  _Ia_2 = 0.0
 ( 2)  _Ia_3 = 0.0
 ( 3)  _Ia_4 = 0.0

       F(  3,    12) =    7.34
            Prob > F =    0.0047

How to cite this page

Report an error on this page

UCLA Researchers are invited to our Statistical Consulting Services
We recommend others to our list of Other Resources for Statistical Computing Help
These pages are Copyrighted (c) by UCLA Academic Technology Services


The content of this web site should not be construed as an endorsement of any particular web site, book, or software product by the University of California