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

Re: st: Equality of means and pweights


From   May Boggess <[email protected]>
To   [email protected]
Subject   Re: st: Equality of means and pweights
Date   08 Jul 2003 17:01:19 -0500

Daniel,

I am not sure what you mean when you say the dependent
variable is ordinal AND continuous,
so I am just going to assume it's a continuous numerical variable.
I'll be calling this variable y.

I'll call the independent variable x, which I'll assume
is numerical, but discrete (discrete because I am supposing
you want to test the means of y over the levels of the factor x).

I'll also suppose the pweights are in a variable called p.

To keep the observations between the first and forth quartile
then drop the observations you don't need by doing:

summarize y, detail
drop if y > r(p75)
drop if y < r(p25)

(By changing y to x in these lines of code you will
drop the observations that are between the first and forth quartile
of your independent variable x.)

To do an equality of means I am supposing you want an
ANOVA table, and (as you know) Stata's -anova- doesn't have a
pweight option. So, here is something you could try.

svyset [pweight=p]

will tell Stata that p is the variable with your pweights in there.

xi: svyregress y i.x 

will do the regression. Then use -test- to get it to tell
you the significance of x:

test _Ix_1 _Ix_2 

(this list should contain all the dummy variables created for x)

hope this is some help,

May Boggess



On Fri, 2003-07-04 at 16:43, DANIEL CARO wrote:
> Dear Statalisters,
> 
>   I'm trying to test the equality of means of a dependent variable (ordinal
>   and continuous) between the first and fourth quartile of an independent
>   variable (in quartiles). Do you know of any command to perform this test
>   that can handle pweights?
> 
>   Thanks a lot for your help,
> 
>   Daniel
> 
> 
> 
> *
> *   For searches and help try:
> *   http://www.stata.com/support/faqs/res/findit.html
> *   http://www.stata.com/support/statalist/faq
> *   http://www.ats.ucla.edu/stat/stata/

*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



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