## asdoc: Cutomizing the regression output | MS Word from Stata | Confidence Interval, adding stars, etc.

Category:asdoc,Blog,Uncategorized

Version 2.3 of asdoc adds the following features for reporting detailed regression tables.

1. Reporting confidence interval

2. Suppressing confidence intervals

3. Suppressing the stars which are used to show significance level

4. Customization of significance level for stars

These features are discussed in details below. If you have not already studied the features of asdoc, you can visit this page that lists the table of contents of what asdoc can do. You can also read this one paragraph introduction to asdoc. The following line of code will install this beta version of asdoc from our website

net install asdoc, from(http://fintechprofessor.com) replace

help asdoc

## Details of the new features

The new features related to creating detailed regression tables with asdoc are discussed below with details.

### 1. Confidence interval

I received several emails and comments on blog posts suggesting the addition of confidence intervals (CI) to the detailed regression tables created by asdoc. In version 2.3 onwards, confidence intervals are shown by default. This means that we do not have to add an additional option to report CI. See the following example.

sysuse auto, clear

asdoc reg price mpg rep78 headroom trunk weight length turn , replace

### 2. Suppressing the confidence interval

If confidence intervals are not needed, we can use option **noci**. For example

asdoc reg price mpg rep78 headroom trunk weight length turn , replace noci

### 3. Suppressing stars

Similarly, if we are not interested in reporting significance stars, we can use option **nostars**. For example,

### 4. Setting custom significance level

The default significance levels for reporting stars are set at : *** for p-values <=0.01; ** for p-values <=0 .05, and * for p-values <=0.1. However, now we can set our own levels for statistical significance using option **setstars**. An example of setstars option looks like:

setstars(***@.01, **@.05, *@.1)

As we can see from the above line, **setstars **separates each argument by a comma. Each argument has three components. The first component is the symbol (in our case it is *) which will be reported for the given significance elve. The second component is the @ sign that connects the significance level with the symbol. And the third component is the value at which the significance level is set. So if we want to report stars such that

* for p-value .001 or less

** for p-value .01 or less

*** for p-value .05 or less

We shall write the option setstars as

setstars(*@.001, **@.01, ***@.05)

Continuing with our example, let us use the above option to report our defined level of stars.

asdoc reg price mpg rep78 headroom trunk weight length turn , replace setstars(*@.001, **@.01, ***@.05)

## 9 Comments

## Ya Zheng

January 7, 2019at 8:16 pmDear Dr. Attaullah Shah,

I am studying your powerful Stata package of asdoc. It doesn’t seem to be available for logistic regression when I want to output OR, right?

Thank you!

## Attaullah Shah

January 7, 2019at 9:42 pmDear Zhengya

Yes, it can be used with logistic regression. See this thread, post 4 and #9 where I have shown how to do it.

https://www.statalist.org/forums/forum/general-stata-discussion/general/1437027-exporting-logistic-regression-outputs-or-and-ci-to-excel

## Ya Zheng

January 7, 2019at 11:20 pmDear Dr. Attaullah Shah,

Thank you for getting back to me. The package will work if I wanna get OR and the 95%CI for OR?

## David Straarup

January 23, 2019at 7:06 pmDear Dr. Attaullah Shah

Tried to update to ver. 2.3 as you recommend.

I have still ver. 2.2??

## Attaullah Shah

January 24, 2019at 8:46 amDavid StraarupDid you install asdoc from SSC from this website? I have not yet uploaded version 2.3 to SSC as I need to test it further. Version 2.3 is available on this website, to download this beta version, you can type the following in the Stata command window

Update: The new version is now available on SSC, to install

## David Straarup

January 24, 2019at 12:11 pmYes, tried update from your location.

The version is still ” Oct 23, 2018, ver 2.2.0″ in “help asdoc”!

## david straarup

January 24, 2019at 12:22 pmDon´t know why….now it works with CI-interval.

Thank you!

## Dong

April 5, 2019at 6:29 pmDear Dr. Attaullah Shah,

I am studying your powerful Stata package of asdoc. When the label or title include Chinese, the result appear messy code in the word. It doesn’t seem to support unicode ?

Thank you!

## Attaullah Shah

April 5, 2019at 6:35 pmDong: I replied to a similar query on Statalist here – posts 45-46, where Chen Samulsion asked about the possibility of passing Chines characters from Stata to a Word file using asdoc. My reply was that getting Chinese characters in an RTF file is a pain in the neck. Usually, getting Chinese characters programmatically into an RTF file does not seem straightforward, one has to first convert the letters to Unicode and then render it properly in the RTF file.I think similar is the case with Nordic characters. Right now, I am struggling with finding a way out.