st: regression with categorical covariate

 From Chris Witte To statalist@hsphsun2.harvard.edu Subject st: regression with categorical covariate Date Sat, 29 Mar 2008 08:49:51 -0700 (PDT)

```I am running version 9.2.

1) I need to run a regression (tw vs. tl) with a categorical covariate (trt). Is the code below the correct way to do this?

anova tw tl trt, continuous(tl) regress

2) If this is the correct way, I get the output below.  Is there a way to take this output and graph the 8 lines (one for each of the covariate levels)?

Source |       SS       df       MS              Number of obs =     232
-------------+------------------------------           F(  8,   223) =  431.03
Model |  291.624203     8  36.4530254           Prob > F      =  0.0000
Residual |  18.8594709   223  .084571618           R-squared     =  0.9393
-------------+------------------------------           Adj R-squared =  0.9371
Total |  310.483674   231  1.34408517           Root MSE      =  .29081
------------------------------------------------------------------------------
tw        Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
------------------------------------------------------------------------------
_cons           -6.723445   .1812834   -37.09   0.000    -7.080693   -6.366197
tl              .1490997   .0026019    57.30   0.000     .1439723    .1542272
trt
1     .1823635   .0891331     2.05   0.042     .0067125    .3580146
2     .0892382   .0956802     0.93   0.352    -.0993149    .2777912
3    -.0792475   .0965642    -0.82   0.413    -.2695426    .1110475
4     .0509725   .0952589     0.54   0.593    -.1367502    .2386953
5     .0516925   .1101982     0.47   0.639    -.1654705    .2688556
6    -.0398991   .0953103    -0.42   0.676    -.2277233     .147925
7    -.0433976   .1102038    -0.39   0.694    -.2605718    .1737765
8    (dropped)

____________________________________________________________________________________
You rock. That's why Blockbuster's offering you one month of Blockbuster Total Access, No Cost.
http://tc.deals.yahoo.com/tc/blockbuster/text5.com
*
*   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/
```