Cross Validated is a question and answer site for people interested in statistics, machine learning, data analysis, data mining, and data visualization. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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!

share|improve this question
up vote 2 down vote accepted

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
share|improve this answer
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.
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.