|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
st: re: p-value in stata???
< >
Bastian said
After running several yearly regressions, I have calculated the mean-
coefficient for each variable. I have also calculated something like a
mean t-value. My problem: How is it possible to calculate the
corresponding p-value in stata? Is it possible to do it in stata at all?
sysuse auto,clear
reg price mpg if foreign
scalar t1 = _b[mpg]/_se[mpg]
scalar n1 = e(N)
reg price mpg if !foreign
scalar t2 = _b[mpg]/_se[mpg]
scalar n2 = e(N)
scalar avgt = 0.5 * (t1 + t2)
scalar avgn = 0.5 * (n1 + n2)
scalar avgp = ttail(avgn, abs(avgt))
di _n "Average t(" avgn ") = " avgt " with pval = " avgp
Kit Baum, Boston College Economics and DIW Berlin
http://ideas.repec.org/e/pba1.html
An Introduction to Modern Econometrics Using Stata:
http://www.stata-press.com/books/imeus.html
*
* 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/