Statalist


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: comparing the means of two variables(not groups) for suvey data


From   Mandy fu <[email protected]>
To   [email protected]
Subject   st: comparing the means of two variables(not groups) for suvey data
Date   Tue, 18 Aug 2009 21:49:10 -0400

Hi all,

Previous discussion of comparing means in survey data are focus on two
groups. I am interested in comparing means of two variables in survey
data.

For example, in the following data set for students test scores, I'd
like  to compare the population means of "read" and "write". I was
wondering , since the probability weight for each student is constant,
if  it is fine that  I just use t test? If I need to use probability
weight, how to do that after the survey mean estimation?

I tried --svy:mean-- and then use--lincom--. But since there seems
always some errors message.
---------------------------------------------
use http://www.ats.ucla.edu/stat/stata/notes/hsb2, clear
svyset [pw=socst], strata(ses)
      *** t test
ttest read=write
     ***svy and lincom
svy:mean read
matrix B=e(b)
svmat B
svy:mean write
matrix C=e(b)
svmat C
lincom B C
**regressor B1 not found
**r(111);
------------------------------------
Thanks for your help!

Mandy
*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   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