Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: get est.prop from svyprop


From   [email protected] (Jeff Pitblado, StataCorp LP)
To   [email protected]
Subject   Re: st: get est.prop from svyprop
Date   Wed, 04 May 2005 13:00:46 -0500

Markus Steiner <[email protected]> asks about saved results from the
-svyprop- command:

> after using the svyprop command I would like to use the estimated proportions
> from svyprop for further analysis/modeling. I couldn't find a possibility to
> store the results in an new data file and I am wondering if I missed something
> out. As I have many by groups writing down the results from the screen and
> input them into a new file is not really an option for me. Does anyone have a
> suggestion how to get on here or any other possibilities/commands which would
> allow me to do this job?

In Stata 8, -svyprop- doesn't save anything in e() and what is saves in r() is
not very helpful to users.  The good news is that you can use a combination of
the -xi:- prefix with -svymean- to get the estimated proportions in e(b).

Here is an example using the auto dataset:

	. sysuse auto
	. svyset, srs
	. xi: svymean i.rep78, by(foreign)

In the above, we use -svymean- to estimate the proportions for
each category of -rep78- for each subpopulation defined by the categories for
-foreign-.

In Stata 9, the -svy: proportion- command actually saves in e(); thus you do
not need -xi- and -svy: mean-.  In this case the above example is:

	. sysuse auto
	. svyset _n
	. svy: proportion rep78, by(foreign)

--Jeff
[email protected]
*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   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