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 at the end of May, and its replacement, statalist.org is already up and running.


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

Re: st: saving -proportion- estimates to a .dta or .csv file


From   Richard Williams <richardwilliams.ndu@gmail.com>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: saving -proportion- estimates to a .dta or .csv file
Date   Thu, 03 Nov 2011 13:27:19 -0500

At 11:54 AM 11/3/2011, Tim Evans wrote:
I'm trying to save and export the proportion estimates I obtain from using -proportion- into a useable data file, either .csv or .dta.

However having googled this and looked at help resources with -proportion- I don't seem to find what I am after.

How would I return the results from the following code into a data file:

sysuse auto
proportion rep78 , over(foreign)

The estimates are ereturned in e(b). If nothing else you could generate variables equal to those values, cut your data set down to one case, and save under a new name. Something like

sysuse auto
proportion rep78 , over(foreign)
matrix bmat = e(b)
forval j = 1/10 {
gen prop`j' = bmat[1,`j']
}
sum prop*



-------------------------------------------
Richard Williams, Notre Dame Dept of Sociology
OFFICE: (574)631-6668, (574)631-6463
HOME:   (574)289-5227
EMAIL:  Richard.A.Williams.5@ND.Edu
WWW:    http://www.nd.edu/~rwilliam

*
*   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/


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