# How can I test for trend across ordinal groups in Stata?

I have 4k observations on individuals distributed across 10 ordinal categories of socio-economic position (1 being worst, 10 - best).

What kind of statistical test could I use in Stata to judge if there is a trend across these ten ordinal categories when it comes to:

1. Continuous variable (income)?
2. Ordinal categorical variable (response coded from 0 'difficult' to 11 'easy')

Thanks a lot for help!

-

In both situations, you can use the nptrend command

nptrend income, by(socecopos)


Alternatively you could also test for a monotonic trend by using spearman's rank correlation:

spearman income socecopos

-
Thanks. Looks promising, however nptrend seems to have some issues when it comes to scaling. –  radek Oct 9 '11 at 9:39
Yes, but on the same page you find a link to a possible solution ;-) –  user5644 Oct 9 '11 at 14:37

Some other pointers from around the Web:

• Stata's website suggests modelling using regress command.
• Same website also suggests using vwls command for Variance-weighted least squares.
• Roger Newson (on statalist) suggested somersd package (article in Stata Journal), however I wasn't able to find my way around this solution.
-