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 on April 23, and its replacement, is already up and running.

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

Re: st: test for trend of an ordinal predictor

From   Georgia <>
Subject   Re: st: test for trend of an ordinal predictor
Date   Mon, 26 Apr 2010 14:23:06 +0100

On 26/04/2010 14:10, Maarten buis wrote:
--- 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: )

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:

*------------ 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: )

Hope this helps,

Heise, David R. (1972). Employing nominal variables,
induced variables, and block variables in path
analysis.  Sociological Methods&  Research, 1(2):

Maarten L. Buis
Institut fuer Soziologie
Universitaet Tuebingen
Wilhelmstrasse 36
72074 Tuebingen

*   For searches and help try:
Ok! That was very helpful!
Thanks a lot!

*   For searches and help try:

© Copyright 1996–2016 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index