Statalist


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

Re: Re: Re: st: How to make certain variable names and related coefficients red in the word in the -estout-?


From   [email protected]
To   statalist<[email protected]>
Subject   Re: Re: Re: st: How to make certain variable names and related coefficients red in the word in the -estout-?
Date   Wed, 19 Aug 2009 00:22:18 +0800

Ben,
thank you very much for your earnest explanation. I understood it now.
An additional doubt is that when I apply the colortbl to the coefficient or some other options
in the -esttab- stata shows an error "_{ invalid name".

For example,

sysuse auto, clear
reg price weight mpg
local colortbl "{\colortbl;\red255\green0\blue0;\red0\green0\blue255;}"
esttab using test.rtf, append title(`colortbl'Table 1: blah)  ///
cells(b "{\cf1 weight}") stats(r2_a,labels(adj-R2 "{\cf1 adj-R2}")) ///
coeflabels(weight "{\cf1 weight}" mpg "{\cf2 mpg}")


Thank you a lot

Best regards,
Rose.
----- Original Message -----
From: Ben Jann <[email protected]>
To: [email protected]
Subject: Re: Re: st: How to make certain variable names and related coefficients red in the word in the -estout-?
Date: 2009-8-18 03:08:47

"{\colortbl;...}" means "this is the color table".

"red255\green0\blue0" means mix a RGB color with 255 red, 0 green, and
0 blue (255 is maximum intensity).

colors are specified one after another with a semicolon after each color.

"\cf1" means "pick the first color, "\cf2" means "pick the second color"

BTW: You could also type

coeflabels(weight "\cf1 weight" mpg "\cf2 mpg")

(that is, you can omit the curly braces; however, the curly braces are
needed for the color table).
ben

2009/8/17 <[email protected]>:
> Ben,
> thank you very much for your help.
> It works well, though I do not understand the typing clearly.
>
> Thank you.
>
> Best regards,
> Rose.
>
> ----- Original Message -----
> From: Ben Jann <[email protected]>
> To: [email protected]
> Subject: Re: st: How to make certain variable names and related coefficients red in the word in the -estout-?
> Date: 2009-8-17 17:12:17
>
> The issue with colors is that a color table has to be defined before
> the colors can be used in RTF. The main problem is how to get the
> color table into the document. Although not very elegant, you could
> use the -title()- option for this. Here is an example with blue and
> red:
>
> sysuse auto, clear
> reg price weight mpg
> local colortbl "{\colortbl;\red255\green0\blue0;\red0\green0\blue255;}"
> esttab using test.rtf, replace ///
> title(`colortbl'Table 1: blah) ///
> coeflabels(weight "{\cf1 weight}" mpg "{\cf2 mpg}")
>
> Another approach would be to hack esttab.ado and hardwire the color
> table in the beginning where the RTF preamble is defined.
> ben
>
> 2009/8/16 <[email protected]>:
>> Dear statalists,
>>
>> I have a question on the -esttab-. I want to esttab results to word.
>> Is there a way to make certain 爒ariable names and related coefficients red in the word?
>> Or make the contents of -addnotes- option in the -esttab- red?
>>
>> Thank you very much for any help.
>>
>>
>>
>> Best regards,
>>
>> Rose.
>>
>>
>> *
>> * 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/
>
> *
> * 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/

*
*   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–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index