Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: test for trend with svy commands?

From   Stas Kolenikov <>
Subject   Re: st: test for trend with svy commands?
Date   Thu, 21 Oct 2004 14:51:36 -0400

an easy thing to do is to create use the variable -year-, or better
centered version of that,

sum year, mean
g cyear = year - r(mean)

and put it into your regression

svyreg male cyear

If it is statistically significantly greater than zero, it means that
on average the proportion of males was going up over entire period. Of
course if you have non-monotone patterns, then this approach is simply

More rigorously, you should have tests one by one, but two
complications here are (i) that your compsite alternative is weird
(male[1996] < male[1998] < male[2000] which is a cone; testing this
hypothesis leads to all sorts of complications on the boundary of the
admissible parameter space. I should have references on this if you
are interested; they go back to Chernoff (1954) paper on testing on
the boundary, and another paper on testing monotone relations on cone
that I cannot seem to find in the pile of PDF files on my three
computers... and complication number 2 (ii) is that your type I error
goes wild in those one-by-one tests.

The simplest way is to disregard all of the previous paragraph and
just use the linear term :))


On Thu, 21 Oct 2004 13:11:31 -0400, Melissa D. A. Carlson
<> wrote:
> Can the svy commands in stata do a test for trend? I have 5 years of data
> and say, for example, I want to test if the proportion of patients in my my
> sample that are male has increased over the five years. I have compared the
> years 2x2 (so 200 vs 1998, 1998 vs 1996, etc) using svytest and svylc but
> how do I test that there is a trend in the data over the 5 years?

Stas Kolenikov
*   For searches and help try:

© Copyright 1996–2017 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index