Statalist The Stata Listserver


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: -estimates table- display question


From   "Michael S. Hanson" <[email protected]>
To   [email protected]
Subject   st: -estimates table- display question
Date   Fri, 19 Jan 2007 17:59:27 -0500

I have a particular question regarding the display of a table of regression results using -estimates table-. I have written a short .do file that simulates a series of random (x,y) draws from a simple linear relationship to illustrate the difference between the population regression relationship and the estimated sample regression line, as well as the role of sampling variation, for my econometrics course this semester. The relevant extract is below (with local variables appropriately defined previously in the program):

// --- BEGIN CODE --- //

forvalues i = 1/`m' {
drawnorm u`i', n(`n') sds(sd)
}

gen x = uniform()*r
sort x

gen ytrue = a + b*x
quietly regress ytrue x
est store true

forval i = 1/`m' {
gen y`i' = ytrue + u`i'
quietly regress y`i' x
quietly predict y`i'hat
est store reg`i'
}

est table *, b(%4.2f) se p stats(r2 rmse)

// --- END CODE --- //


This program will be run "live" during my lecture, so I'm looking for as clear a table of results as possible. Notice that the p-values that are reported in the -est table- command are not particularly interesting for this application; rather, I'd like to list the p- values that correspond to the following tests, given that the true population parameters are known in this simulation:

test _b[_cons] = a
test _b[x] = b
test (_b[_cons] = a) (_b[x] = b)

It appears that I can accomplish this objective in part with - estadd-, such as:

quietly test _b[_cons] = a
estadd scalar p_a = r(p)
...
est table *, b(%4.2f) se stats(p_a r2 rmse)

However, for pedagogical reasons, I'd prefer the p-values to be grouped with the coefficient estimates and SEs, rather than lumped with the other summary statistics for the regression as a whole. Is this possible?

By the way, I have looked at -estout- to create the table, but it has a few shortcomings for my purposes. Most significantly, it doesn't output SMCL, so the tables are not (IMO) suitable for classroom presentation. I also cannot get it to group the above- computed p-values with the coefficient estimates and SEs. (Note that I have very limited facility with -estout-, so there may be a way to do what I want that I am unaware of.) Any suggestions for producing this table output would be appreciated.

-- Mike


*
* For searches and help try:
* http://www.stata.com/support/faqs/res/findit.html
* 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