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]

From |
Emmanouil Mentzakis <ementzakis@gmail.com> |

To |
statalist@hsphsun2.harvard.edu |

Subject |
Re: st: name conflict in posting a matrix |

Date |
Tue, 10 Jul 2012 16:39:16 +0100 |

Dear Maarten, Thank you for the example. If on top of the betas I wanted to also bootstrap e.g. the y_fit how would I do it in the same program? Below I ve edited your example to show what I d like to do but as expected it produces an error. Thank you very much for your time Regards Manos ******************** clear all sysuse auto program define toboot, eclass tempname b xb xb_s reg price mpg foreign matrix `b' = e(b) reg rep78 mpg foreign matrix `b' = `b', e(b) matrix colnames `b' = price:mpg price:foreign price:_cons /// rep78:mpg rep78:foreign rep78:_cons ereturn post `b' predict `xb', xb sum `xb' ereturn scalar `xb_s'= r(mean) end bootstrap _b xb=e(xb_s), reps(100) :toboot On Tue, Jul 10, 2012 at 4:07 PM, Maarten Buis <maartenlbuis@gmail.com> wrote: > On Tue, Jul 10, 2012 at 4:11 PM, Emmanouil Mentzakis wrote: >> I think the problem is that I don’t tell -ereturn- correctly that I >> have two equations with the same covariates (I try to rename them >> using -matrix coleq-) and it therefore sees the same covariates names >> appear multiple times, hence the name conflict. However, I often >> models in Stata use the same covariates in multiple equations and >> naming them with a prefix similar to eq1 etc. > > *------------------------- begin example ------------------------------ > clear all > sysuse auto > > program define toboot, eclass > tempname b > reg price mpg foreign > matrix `b' = e(b) > reg rep78 mpg foreign > matrix `b' = `b', e(b) > matrix colnames `b' = price:mpg price:foreign price:_cons /// > rep78:mpg rep78:foreign rep78:_cons > ereturn post `b' > end > > bootstrap _b, reps(100) :toboot > *-------------------------- end example ------------------------------- > > Hope this helps, > Maarten > > -------------------------- > Maarten L. Buis > Institut fuer Soziologie > Universitaet Tuebingen > Wilhelmstrasse 36 > 72074 Tuebingen > Germany > > > http://www.maartenbuis.nl > -------------------------- > > * > * 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/ * * 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/

**Follow-Ups**:**RE: st: name conflict in posting a matrix***From:*Nick Cox <n.j.cox@durham.ac.uk>

**References**:**st: name conflict in posting a matrix***From:*Emmanouil Mentzakis <ementzakis@gmail.com>

**Re: st: name conflict in posting a matrix***From:*Nick Cox <njcoxstata@gmail.com>

**Re: st: name conflict in posting a matrix***From:*Emmanouil Mentzakis <ementzakis@gmail.com>

**Re: st: name conflict in posting a matrix***From:*Maarten Buis <maartenlbuis@gmail.com>

- Prev by Date:
**Re: st: name conflict in posting a matrix** - Next by Date:
**st: Pooled Data with Autoregressive error term and Endogenous Variable** - Previous by thread:
**Re: st: name conflict in posting a matrix** - Next by thread:
**RE: st: name conflict in posting a matrix** - Index(es):