Statalist


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

SV: st: Survey data


From   "Tomas Lind" <[email protected]>
To   <[email protected]>
Subject   SV: st: Survey data
Date   Mon, 31 Aug 2009 14:30:16 +0200

Thanks Stas for your help with my survey data. It works fine.

/Tomas



-----Ursprungligt meddelande-----
Från: [email protected]
[mailto:[email protected]] För Stas Kolenikov
Skickat: den 27 augusti 2009 18:56
Till: [email protected]
Ämne: Re: st: Survey data

Tomas,

you would need to -append- these data sets (assuming the variables
have the same name), and re-declare the survey design to have the
super-strata of the year of data. So if you have psu, samplwt, strata,
year on top of your variables, you could

use data99
gen year = 1999
* unless it is already there
append data07
replace year = 2007 if missing(year)
* unless it is already there
egen strataXyear = group(year strata)
svyset psu [pw=samplwt], strata(strataXyear)
svy: mean hearingstatus , over( year agegrp )
lincom whatever you need

I am sure there are -table- analogues of that weird -svy: mean-
followed by -lincom-, and you probably know them better than I do :).

The above analysis assumes you have independent samples in 1999 and
2007. If you don't (e.g. you have longitudinal data), things are more
complicated. But since you have different strata, you probably have
independent samples. Check with your data collecting agency.

On Thu, Aug 27, 2009 at 10:17 AM, Tomas Lind<[email protected]> wrote:
> Dear Statalisters
>
> Comparing surveys from two different years with DIFFERENT pweight´s and
> stratum each year.
>
> Does anyone have a Statasolution to this problem?
>
> Is there a difference in hearing between 1999 and 2007 (overall and for
> specific agegroups)?
>
> The columns prop1999 and prop2007 show the proportion of people with
> impaired hearing.
> I have all the individual data behind this aggregated table in my dataset
> (id, age, hearingstatus).
> Table is constructed from two different datasets with different svyset
(two
> different analysis).
>
> Agecat         Prop1999           Prop2007
> 18-29            0.09               0.10
> 30-39            0.10               0.11
> 40-49            0.15               0.16
> 50-59            0.23               0.27
> 60-65            0.33               0.35
>
>
> Tomas
>
>
> *
> *   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/
>



-- 
Stas Kolenikov, also found at http://stas.kolenikov.name
Small print: I use this email account for mailing lists only.

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


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