Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.

# Re: st: how to escalate coefficients using outreg2 or a similar program?

 From John Luke Gallup To statalist@hsphsun2.harvard.edu Subject Re: st: how to escalate coefficients using outreg2 or a similar program? Date Fri, 19 Oct 2012 11:12:27 -0700

```Maarten,

I think Benjamin will still have a problem with the -syntax varlist- command below because the -cmp- command has multiple equations rather than a varlist.

Benjamin can use -syntax anything(equaok)- instead of -syntax varlist- to solve that problem.  Then the program would look like

program escalate, eclass
version 12.1
syntax anything(equaok) [if] [in] [fw pw aw iw] [, *]
cmp `anything' `if' `in' `weigth' `exp', `options'
tempname newb newV
matrix `newb' = e(b)
matrix `newV' = e(V)
... code to change newb and newV ...
ereturn post `newb' `newV' ...
end

John

On Oct 19, 2012, at 12:36 AM, Maarten Buis <maartenlbuis@gmail.com> wrote:

> Nothing changes, except for the part  ... code to change newb and newV
> ... but that was the part you had to fill in anyhow.
>
> -- Maarten
>
> On Thu, Oct 18, 2012 at 8:33 PM, Benjamin Villena <b_villena@yahoo.com> wrote:
>> Dear John (or anyone else who knows the answer)
>> The example you gave is great, but I am using a multiequation estimation command called cmp (Roodman 2012)
>> How can I adapt your example if I have to estimate this multiequation model with cmp using standardized regressors ?
>>
>> cmp (y1= x1-x10 z) (y2 = x1-x10 z)  (y3= x1-x10 z) (y4= x1-x10 z) (y5= x1-x10 w)  if ss=1, `options'
>>
>> In other words, how can I write the 'syntax' line of my new program to be able to invoke cmp with the right syntax within the new ado file?
>>
>> Thanks,
>>
>>
>> ----- Original Message -----
>>> From: John Luke Gallup <jlgallup@pdx.edu>
>>> To: statalist@hsphsun2.harvard.edu
>>> Cc:
>>> Sent: Wednesday, October 17, 2012 6:44 PM
>>> Subject: Re: st: how to escalate coefficients using outreg2 or a similar program?
>>>
>>> -outreg2- (and -outreg-) take all their information about the coefficients
>>> directly from the e(b) and e(V) matrices, so you _have_ to modify these matrices
>>> if you want to report non-standard estimates.  These matrices can only be
>>> modified by an -eclass- program, so you must create a program within your .do
>>> file to do this.  In Benjamin's case, it sounds like he has already created
>>> a new estimation command, so all he has to do is use -ereturn post- to save the
>>> results in the e(b) and e(V) matrices before running -outreg2-.
>>>
>>> pseudocode to do this would look like:
>>>
>>> program escalate, eclass
>>>   version 12.1
>>>   syntax varlist [if] [in] [fw aw] [, *]
>>>   oldestimationcommand `varlist' `if' `in' `weigth' `exp',
>>> `options'
>>>   tempname newb newV
>>>   matrix `newb' = e(b)
>>>   matrix `newV' = e(V)
>>>      ... code to change newb and newV ...
>>>   ereturn post `newb' `newV' ...
>>>    [-ereturn post- clears all the previously posted e() information, so
>>> everything you want to keep has to be reposted in the -ereturn post- command]
>>> end
>>>
>>> John
>>>
>>> On Oct 17, 2012, at 7:45 AM, Benjamin Villena <b_villena@yahoo.com> wrote:
>>>
>>>> Hello Statalist members,
>>>>
>>>> In order to numerically stabilize an estimation procedure that uses
>>> complicated numerical integration, I need to standardize my regressors X.
>>>>
>>>> I plan to use outreg2 to put  several specifications in a table using the
>>> same estimation method.
>>>>
>>>> However, I want to report escalated coefficients and standard deviations
>>> instead of the ones I get directly from my estimation routine. In other words, I
>>> want to divide each coefficient and its standard error by the sample standard
>>> deviation of the associated regressor after the estimation, and report them in a
>>> table.
>>>>
>>>>  I guess I could manipulate e(b) and e(V) in order to get what I want, but
>>> then I think I could not use outreg2 to create a table. Is there a simple way to
>>> do this using already built code such as outreg2 or similar?
>>>>
>>>> Thanks,
>>>>
>>>> *
>>>> *   For searches and help try:
>>>> *  http://www.stata.com/help.cgi?search
>>>> *   http://www.stata.com/support/faqs/resources/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/faqs/resources/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/faqs/resources/statalist-faq/
>> *   http://www.ats.ucla.edu/stat/stata/
>
>
>
> --
> ---------------------------------
> Maarten L. Buis
> WZB
> Reichpietschufer 50
> 10785 Berlin
> Germany
>
> http://www.maartenbuis.nl
> ---------------------------------
> *
> *   For searches and help try:
> *   http://www.stata.com/help.cgi?search
> *   http://www.stata.com/support/faqs/resources/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/faqs/resources/statalist-faq/
*   http://www.ats.ucla.edu/stat/stata/
```