Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
st: Domain analysis of survey data
From
Brad Cannell <[email protected]>
To
[email protected]
Subject
st: Domain analysis of survey data
Date
Fri, 16 Jul 2010 18:23:07 -0400
Hello,
I'm new to stata. I'm analyzing a large weighted state survey (Behavioral Risk Factor Surveillance System) to create a state report. In this report I need to do a separate descriptive table for each county in the state, which includes proportions of the county that fall into various different categories. In SAS I would have done it like this (hypothetical):
proc surveyfreq data=statereport;
table agegroup race education income maritalstatus smokingstatus;
by county
weight finalweight
strata stratvar
run;
The "by county" because that is the command that would have repeated the frequency tables of age, race, education, etc for each county.
So far in stata I have been able to designate the dataset as survey data with the correct weight and strata variables identified. I have also been able to produce frequency tables of age, race, education, etc for the dataset as a whole using "svy: prop age race education". However, after a lot of searching I am unable to find a way to get stata to give me a separate analysis for each county. I really don't want to use "if" statements to program the analysis for each county separately. When I try "by county: svy: prop age race education" I get an error message saying that by statements can't be used with survey commands. Does anyone have a suggestion?
Thanks,
Brad
*
* 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/