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

st: Re: Re: t-tests for differences in means using pweights


From   "Scott Merryman" <[email protected]>
To   <[email protected]>
Subject   st: Re: Re: t-tests for differences in means using pweights
Date   Thu, 26 Jun 2003 20:22:33 -0500

----- Original Message ----- 
From: <[email protected]>
To: <[email protected]>
Sent: Thursday, June 26, 2003 10:33 AM
Subject: st: Re: t-tests for differences in means using pweights


> I don't think my original posting was clear enough.  What I have are two
unique
> samples, one from the first wave of a survey and the other from the next
wave.
> In each wave respondents were asked the same question, and I'm looking at
> aggregate means on this question for each wave of the survey.  I'm trying
to
> determine whether the difference in the mean value of the variable among
> respondents in the first wave is significantly different from the mean
among
> respondents in the second wave (after weighting the responses with
pweights).
> The problem is that the samples are unique, so I can't use the "svymean"
> or "svylc" commands, but I also can't use the "ttest" command b/c it does
not
> accept pweights.  I hope this is clearer than the first post below, and
again I
> would appreciate any thoughts.  Thanks in advance.
>
> Pat Sharkey
> Doctoral student in Sociology and Social Policy
> Harvard University


How about using a dummy variable and svyreg.  Using the auto dataset,
suppose sample 1 is the price of car domestic cars and sample 2 is the price
of foreign cars and the sampling weight is the weight variable.


. use "C:\Stata8\auto.dta", clear
(1978 Automobile Data)

. svyset [w=weight]
(sampling weights assumed)
pweight is weight

. svyreg price for

Survey linear regression

pweight:  weight                                  Number of obs    =
74
Strata:   <one>                                   Number of strata =
1
PSU:      <observations>                          Number of PSUs   =
74
                                                  Population size  =
223440
                                                  F(   1,     73)  =
0.13
                                                  Prob > F         =    0.72
13
                                                  R-squared        =
0.0015

----------------------------------------------------------------------------
--
       price |      Coef.   Std. Err.      t    P>|t|     [95% Conf.
Interval]
-------------+--------------------------------------------------------------
--
     foreign |   298.4742   833.3626     0.36   0.721    -1362.415
1959.363
       _cons |   6500.577   503.7304    12.90   0.000     5496.644
7504.51
----------------------------------------------------------------------------
--

The t-stat on the dummy variable tests if the mean price of foreign cars is
equal to the mean price of domestic cars.
So, the null hypothesis of Ho: mean(Domestic) - mean(Foreign) = 0 can be
rejected at usual significance levels.


Scott


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