Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.
From | Maarten buis <maartenbuis@yahoo.co.uk> |
To | statalist@hsphsun2.harvard.edu |
Subject | Re: st: test for trend of an ordinal predictor |
Date | Mon, 26 Apr 2010 06:10:51 -0700 (PDT) |
--- On Mon, 26/4/10, Georgia wrote: > I am fitting a regression model with a normally distributed > outcome (y) and an ordinal variable in 3 levels (x) as > predictor. Obviously, when I use the command > > xi: regress y i.x > > I get separate coefficients for the second and the third > level of the predictor while the first level is treated as > reference. However, I would be very interested in testing > the trend of the ordinal variable. In such a case, do I > simply treat my ordinal var as a continuous one by typing > > regress y x > > or is there a better way to test the trend of x? The latter model assumes that the "distance" between the first and second category is the same as the "distance" between the second and the third. To test this null- hypothesis you can use either -test- after your model with dummy variables, or estimate both models and compare them using -ftest- (downloadable from SSC). As you can see in the example below, the results are exactly the same. *---------- begin example ------------ sysuse auto, clear recode rep78 1/2=3 reg mpg i.rep78, coeflegend test 2*_b[4.rep78] = _b[5.rep78] est store a ssc install ftest reg mpg rep78 ftest a . *----------- end example -------------- (For more on examples I sent to the Statalist see: http://www.maartenbuis.nl/example_faq ) However, the hypothesis that the distances between categories are the same in a categorical variable is usualy not a sensible hypothesis. In those cases you can better estimate the distances between the categories together with the effect of the underlying continuous variable. A straightforward way of doing is to use so-called sheaf coefficients (Heise 1972) This approach is implemented in the -sheafcoef- package (also downloadable from SSC), which is discussed here: <http://www.maartenbuis.nl/wp/prop.html> *------------ begin example ---------- sysuse auto, clear recode rep78 1/2=3 tab rep78, gen(rep) reg mpg rep2 rep3 ssc install sheafcoef sheafcoef, latent(rep: rep2 rep3) *------------- end example ------------ (For more on examples I sent to the Statalist see: http://www.maartenbuis.nl/example_faq ) Hope this helps, Maarten Heise, David R. (1972). Employing nominal variables, induced variables, and block variables in path analysis. Sociological Methods & Research, 1(2): 147--173. -------------------------- Maarten L. Buis Institut fuer Soziologie Universitaet Tuebingen Wilhelmstrasse 36 72074 Tuebingen Germany http://www.maartenbuis.nl -------------------------- * * 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/