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: Problem with estout and rename

 From Cory Smith To statalist@hsphsun2.harvard.edu Subject Re: st: Problem with estout and rename Date Wed, 20 Mar 2013 11:37:51 -0400

```Hi Rebecca,

Thanks for your concern about the clarity of the piece. In general, I
think the merge aspect of the rename() function comes in handy when
there are different ways to measure or proxy for the same variable. To
give a crude simplification in my case, I am looking at how disease in
location A predicts disease in location B. But, since it takes time
for disease to spread across space, maybe I should look at the disease
in A from one month ago (i.e. a lag).

In a big table with 8+ regressions, it will be easier for a reader
just to scan one line to determine how many models show such a
relationship (rather than having to bounce across two lines depending
on whether there is a lag or not). Other lines in the table and the
text in the paper will make clear which measures are used in a given
regression.

Thanks again for all the help,
Cory

On Wed, Mar 20, 2013 at 11:18 AM, Rebecca Pope <rebecca.a.pope@gmail.com> wrote:
> None that I know of, but that doesn't mean there isn't.
>
> On Wed, Mar 20, 2013 at 10:15 AM, Cory Smith <corybsmith@gmail.com> wrote:
>> Rebecca,
>>
>> After playing around a little more, I realized I could use BOTH
>> rename() and varlabels() to achieve the desired effect. I can merge
>> the different variables to something common (with no spaces) with
>> rename() and then change the label to something else (with spaces)
>> using varlabels(). e.g.  rename(x "DifferentialTransfer" L.x
>> "DifferentialTransfer") varlables("DifferentialTransfer" "Differential
>> Transfer")
>>
>> I'd be curious if there's a more elegant solution, but this will do
>> for now. Thanks for pointing me in the right direction.
>>
>> Cory
>>
>> On Wed, Mar 20, 2013 at 10:58 AM, Cory Smith <corybsmith@gmail.com> wrote:
>>> Hi Rebecca,
>>>
>>> Thanks for this. It's a good solution to the simple example I gave.
>>> Unfortunately, in trying to keep my post short, I didn't mention that
>>> I really do need to use rename(). In certain models, I use L.x [lag of
>>> x] in place of x and I want to have these coefficients show up in the
>>> same line. That is, the coefficient for x (in one model) and L.x (in
>>> another model) would both show up in the row entitled "Transfer
>>> Coefficient."
>>>
>>> Is there any way to fix my problem in this more complex example? Thanks!
>>>
>>> Cory
>>>
>>> On Wed, Mar 20, 2013 at 10:23 AM, Rebecca Pope <rebecca.a.pope@gmail.com> wrote:
>>>> Cory,
>>>> Use the -varlables()- option instead.
>>>>
>>>> ** example **
>>>> version 11.2
>>>> sysuse auto, clear
>>>> qui regress price mpg
>>>> estimates store m1
>>>> qui regress price mpg foreign
>>>> estimates store m2
>>>> *local mpglbl: var label mpg
>>>> *estout m1 m2, varlabels(mpg "`mpglbl'")
>>>> estout m1 m2, varlabels(mpg "Milage (mpg)")
>>>> ** end **
>>>>
>>>> ** output**
>>>>
>>>>                                m1             m2
>>>>                                    b                b
>>>>
>>>> Milage (mpg) -238.8943 -294.1955
>>>> foreign                             1767.292
>>>> _cons             11253.06  11905.42
>>>>
>>>> The two commented lines starting with -local- can be using if your
>>>> variable is already labeled with the text you want to use.
>>>>
>>>> Regards,
>>>> Rebecca
>>>>
>>>> On Wed, Mar 20, 2013 at 8:57 AM, Cory Smith <corybsmith@gmail.com> wrote:
>>>>> Hi statalisters,
>>>>>
>>>>> I'm running multiple regression models which are all pretty similar. I
>>>>> want to rename the main coefficient in all of them from x to "Transfer
>>>>> Coefficient." Unfortunately, while
>>>>>
>>>>> estout M1 using ... , rename(x "Transfer Coefficient") [i.e. one
>>>>> model] works as expected
>>>>> estout M1 M2 using ... , rename(x "Transfer Coefficient") [i.e.
>>>>> multiple models] produces weird results where "Transfer Coefficient",
>>>>> "Transfer", and "Coefficient" are all lines in the table.
>>>>>
>>>>> I could reproduce this in a simpler setting, so I think it's a general
>>>>> problem. Anyone know a solution? Thanks!
>>>>>
>>>>> Cory
>>>>>
>>>>> Stata version 11.2
>>>>> estout version just updated today using ssc install estout
>>>>> *
>>>>> *   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/
> *
> *   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/
```