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

st: re: p-value in stata???

From   Christopher Baum <>
Subject   st: re: p-value in stata???
Date   Wed, 29 Oct 2008 15:47:41 -0400

< >
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
An Introduction to Modern Econometrics Using Stata:

*   For searches and help try:

© Copyright 1996–2015 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index