You can save the results from -svymean- to a new matrix and then use that
matrix to solve your problem:
. svymean ss1 ss2 ss3
. ereturn list
. matrix list e(b)
. matrix means = e(b)
. matrix list means
. display "gen z= " means[1,1] "*" means[1,2] "*" means[1,3]
. gen z= means[1,1]*means[1,2]*means[1,3]
. matrix drop means
Dan Blanchette
Applications Analyst Programmer
Carolina Population Center UNC-CH
[email protected]
Takeshi wrote:
---------------------------------------------------------------------------------------
Please tell me how I can create variables from a result of 'svymean'. What is done in the appended simple program is first running the program up to the line "svymean ss1 ss2 ss3" to get results, which can be seen in Stata Results Window, and subsequently punching the numbers into the program using 'gen' command. Is there a way that I can directly use the results of 'svymean' without defining the results as new variables? Thank you for your advise in advance.
**************************
svyset [pweight=weind]
svymean ss1 ss2 ss3
drop ss1-ss3
gen sw1=.0043243
gen sw2=.0006317
gen sw3=.0006557
svyset, clear(iweight)
gen z = sw1*sw2*sw3
******************************************
*
* 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/