Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down on April 23, and its replacement, is already up and running.

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

st: Domain analysis of survey data

From   Brad Cannell <>
Subject   st: Domain analysis of survey data
Date   Fri, 16 Jul 2010 18:23:07 -0400


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

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?

*   For searches and help try:

© Copyright 1996–2016 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index