/*------------------------------------------- ex5.do ---------------------------------------------*/ clear use "C:\Documents and Settings\gillian raab\My Documents\aprojects\ayrarran\exemp5\data\ex5.txt" /*----------------------------------------------------------- first define the design - only need weighting -------------------------------------------------------------*/ svyset [pweight=weight] /*----------------------------------------------------------- now get proportions of various categories compared with unweighted tables -------------------------------------------------------------*/ svyprop q85a tabulate q85a svyprop q85b tabulate q85b svyprop living tabulate living svyprop genhelf tabulate genhelf svyprop empl tabulate empl /*------------------------------------------------------------- now some mean scores to check design effects ----------------------------------------------------------------*/ svymean canscore ampscore genhelf sinc sacc /*------------------------------------------------------------ now some regressions to predict general health score although this is categorical it is quite legitimate to use it in a regression to look for simple associations ----------------------------------------------------------*/ svyregress genhelf sinc canscore ampscore regress genhelf sinc canscore ampscore svyregress canscore sinc tabulate living,g(liv) findit outreg net from http://www.Stata.com svyregress genhelf canscore outreg using output.doc, nolabel replace svyregress genhelf ampscore outreg using output.doc , nolabel append svyregress genhelf sinc outreg using output.doc , nolabel append svyregress genhelf canscore sinc outreg using output.doc , nolabel append svyregress genhelf ampscore sinc outreg using output.doc , nolabel append svyregress genhelf canscore ampscore outreg using output.doc , nolabel append svyregress genhelf canscore ampscore sinc outreg using output.doc , nolabel append