Benchmarks Online

Skip Navigation Links


Page One

Campus Computing News

Maymester Hours

GroupWise News

GNU/Linux at UNT?

Fair Use Rights and Defenses for Students in Online Learning Environments

Today's Cartoon

RSS Matters

The Network Connection

Link of the Month

WWW@UNT.EDU

Short Courses

IRC News

Staff Activities

Subscribe to Benchmarks Online
    

RSS Matters

Link to the last RSS article here: Null Hypothesis Significance Testing

Delivering Results to the End User: Two Stata 8.0 Examples, Part 1

By Patrick McLeod, ACS Research Consultant

One area in which there is a great deal of variance across disciplines in the social sciences is the presentation of results from statistical analyses. I am comfortable reporting analysis in my own field (political science), but in my position in Academic Computing Services I am constantly amazed at the differences in reporting results from discipline to discipline. In this article I’ll discuss two Stata commands that can be used to report a variety of parameters, descriptives, and calculations for delivery to the end user.

You’ve Run Your Models…Now What?

Running statistical models is less than half the battle. Most statistical software, including Stata 8.0, is automated to the point where you can point-and-click your way to whatever model you are attempting to specify. The real works comes in presenting your results and interpreting them in a meaningful manner.

The two commands we will overview today are –estimates table- and –listtex-. Before progressing it would be prudent to insure that both packages are installed and working on your version of Stata. This can be checked by typing –help estimates table- and –help listtex- respectively. If you see Stata help documentation for these packages after typing these commands, then these packages are installed on your system. If you do not see Stata help documentation, then you can find and install these packages by typing –findit estimates table- and –findit listtex- respectively from the Stata command line if your computer is connected to the internet. If you are connected via a dial-up connection, then you may experience a slight wait for the packages to download. If you are connected by a dedicated connection such as a cable modem, DSL, or here at UNT, then the wait will be negligible. 

In the Table and Dreaming: What to Include and How

Depending on the requirements of your original piece of research, your replication, your thesis, or your dissertation, what you will want to include in tables and figures. I am going to use examples in this article reporting coefficients and standard errors for estimated parameters. Both –estimates table- and –listtex-

Using –estimates table-

From the Stata 8 help file for –estimates table-:

Display one or more estimation results in a table

    Basic syntax 

        estimates table [namelist] [, stats(scalarlist) equations(1) star ] 

    Full syntax 

estimates table [namelist] [, stats(scalarlist) equations(matchlist) keep(keeplist) drop(droplist)

                                      star[(#1 #2 #3)] coded b[(fmt)] se[(fmt)] t[(fmt)] p[(fmt)] stfmt(fmt) eform

                                      varwidth(#) modelwidth(#) label style(style_spec) newpanel title(str) ] 

where style_spec = oneline | columns | nolines 

Description

estimates table displays coefficients, "significance stars", standard errors, t/z-statistics, and p-values and scalar statistics of one or more models previously fitted and stored by estimates store.  The last estimated results may be referenced as a period (.) even if not yet stored.  If no model is specified, estimates table reports about the last fitted model. 

estimates table produces a table in which the coefficients are matched by the name of equation and coefficient; seeoption equations() to match equations by number.  Each model in namelist is presented in a column of the table.

estimates table displays blanks in the table cells for those coefficients that are not in a particular model.

estimates table obeys the linesize.

For this example we will use the following:

clear;

#delimit ;

set obs 100;

quietly {;

gen x1=uniform(); gen x2=uniform(); gen x3=uniform();

gen y=1+x1+x2+x3+invnorm(uniform());

regress y x1;        estimates store model1;

regress y x1 x2 ;    estimates store model2;

regress y x1 x2 x3 ; estimates store model3;

};

tempfile model1 model2 model3;

estimates table model1 model2 model3, stats(N chi2) star se;

Using –listtex-

-listtex- is best utilized with some of Roger Newson’s other Stata user-written packages, all available using –findit packagename- where packagename is the name of the package you are trying to locate. For this particular example, -dsconcat- (a package for concatenating results into a table) and –parmby- (a by-able version of –parmest-, another Newson-written package that creates a data set of parameter estimates) will both need to be added to your system before you can run the sample code below: 

clear;

#delimit ;

set obs 100;

quietly {;

gen x1=uniform(); gen x2=uniform(); gen x3=uniform();

gen y=1+x1+x2+x3+invnorm(uniform());

regress y x1;        estimates store model1;

regress y x1 x2 ;    estimates store model2;

regress y x1 x2 x3 ; estimates store model3;

};

tempfile model1 model2 model3;

parmby "reg y x1", lab saving(model1, replace) idn(1) ids(unadjusted);

parmby "reg y x1 x2", lab saving(model2, replace) idn(2) ids(unadjusted);

parmby "reg y x1 x2 x3", lab saving(model3, replace) idn(3) ids(unadjusted);

dsconcat model1 model2 model3;

list parm estimate stderr t min95 max95;

listtex idnum parm label estimate stderr t min95 max95 using example1.tex, rstyle(tabular) replace;

In next month’s Benchmarks Online article we will modify the code presented here using some of the options available in these packages and evaluate their output.

For More Information:

Newson, Roger. Creating plots and tables of estimation results using parmest and friends. Presented at the 8th UK Stata User Meeting, 20-21 May, 2002: http://www.kcl-phs.org.uk/rogernewson/usergp/uk2002.pdf