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, statalist.org is already up and running.

# RE: st: SOLVED! saving -proportion- estimates to a .dta or .csv file last estimates not found

 From Tim Evans To "'statalist@hsphsun2.harvard.edu'" Subject RE: st: SOLVED! saving -proportion- estimates to a .dta or .csv file last estimates not found Date Fri, 4 Nov 2011 11:39:03 +0000

```Ignore last post, have just had another google search and found this helpful thread:

http://statalist.1588530.n2.nabble.com/mim-and-parmest-td5013352.html

from Martin Weiss which shows that mim does not store estimates in e(b) rather e(MIM_Q).

Updated code is this:

proportion stage
matrix bmat = e(MIM_Q)
forval j = 1/4 {
gen prop`j' = bmat[1,`j']
}
sum prop*
collapse (mean) prop*

Best wishes

Tim

-----Original Message-----
From: owner-statalist@hsphsun2.harvard.edu [mailto:owner-statalist@hsphsun2.harvard.edu] On Behalf Of Tim Evans
Sent: 04 November 2011 11:31
To: 'statalist@hsphsun2.harvard.edu'
Subject: RE: st: saving -proportion- estimates to a .dta or .csv file last estimates not found

Having tried both methods suggest by Maarten and Richard, I think Richard's will work best, but I have a problem in that I am using this on a multiple imputed dataset. When I run the analysis, I am returned with an error (details below):

mim: proportion stage if _mj>0 & inrange(yydx,1985,1989)
matrix bmat = e(b)

r(301)

yet when I run this:

proportion stage if _mj>0 & inrange(yydx,1985,1989)
matrix bmat = e(b)
forval j = 1/4 {
gen prop`j' = bmat[1,`j']
}
sum prop*
collapse (mean) prop*

Its absolutely fine - but not what I want.

Any suggestions appreciated.

-----Original Message-----
From: owner-statalist@hsphsun2.harvard.edu [mailto:owner-statalist@hsphsun2.harvard.edu] On Behalf Of Richard Williams
Sent: 03 November 2011 18:27
To: statalist@hsphsun2.harvard.edu
Subject: Re: st: saving -proportion- estimates to a .dta or .csv file

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/

_DISCLAIMER:
This email and any attachments hereto contains proprietary information, some or all of which may be confidential or legally privileged. It is for the exclusive use of the intended recipient(s) only. If an addressing or transmission error has misdirected this e-mail and you are not the intended recipient(s), please notify the author by replying to this e-mail. If you are not the intended recipient you must not use, disclose, distribute, copy, print, or rely on this e-mail or any attachments, as this may be unlawful.

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

_DISCLAIMER:
This email and any attachments hereto contains proprietary information, some or all of which may be confidential or legally privileged. It is for the exclusive use of the intended recipient(s) only. If an addressing or transmission error has misdirected this e-mail and you are not the intended recipient(s), please notify the author by replying to this e-mail. If you are not the intended recipient you must not use, disclose, distribute, copy, print, or rely on this e-mail or any attachments, as this may be unlawful.

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