0

我想问一个关于如何在没有 t-stat 表的情况下计算 p 值的问题,只需查看该表,就像在以下链接http://faculty.arts.ubc 中的 pdf 的第一页上一样。 ca/dwhistler/326UBC/stataHILL.pdf。就像我不知道值 0.062 一样,如何通过查看表中的其他信息知道它是 0.062?

4

2 回答 2

1

您需要使用ttail()返回反向累积学生 t 分布的函数,即概率 T > t:

display ttail(38,abs(_b[_cons]/_se[_cons]))*2

第一个参数 38 是自由度(样本大小减去参数数量),而第二个参数 1.92 是感兴趣系数的绝对值除以其标准误差或 t-stat。2 的因素来自 Stata 正在进行双尾测试这一事实。您还可以将存储的自由度与

display ttail(e(df_r),abs(_b[_cons]/_se[_cons]))*2

您还可以使用 Adrian Mander 的“手工”对 t 密度进行积分integrate

ssc install integrate
integrate, f(tden(38,x)) l(-1.92) u(1.92)

这给你 0.93761229,但你想要 Pr(T>|t|),即 1-0.93761229=0.06238771。

于 2015-03-18T16:52:32.920 回答
0

If you look at many statistics textbooks, you will find a table called the Z-table which will give you the probability that Z is beyond your test statistic. The table is actually a cumulative distribution function of the normal curve.

When people went to school with 4-function calculators, one or more of the questions on the statistics test would include a copy of this Z-table, and the dear students would have to interpolate columns of numbers to find the p-value. In your example, you would see the test statistic between .06 and .07 and those fingers would tap out that it was closer to .06 and do a linear interpolation to come up with .062.

Today, the p-value is something that Stata or SAS will calculate for you.

Here is another SO question that may be of interest: How do I calculate a p-value if I have the t-statistic and d.f. (in Perl)?

Here is a basic page on how to determine p-value "by hand": http://www.dummies.com/how-to/content/how-to-determine-a-pvalue-when-testing-a-null-hypo.html

Here is how you can determine p-value using Excel: http://ms-office.wonderhowto.com/how-to/find-p-value-with-excel-346366/

===EDIT===

My Stata text ("Microeconometrics using Stata", Revised Ed, Cameron & Trivedi) says the following on p. 402.

* p-values for t(30), F(1,30), Z, and chi(1) at y=2
. scalar y=2
. scalar p_t30 = 2 * ttail(30,y)
. scalar p_f1and30 = Ftail(1,30,y^2)
. scalar p_z = 2 * (1 - normal(y))
. scalar p_chi1 = chi2tail(1,y^2)
. display "p-values" " t(30)=" %7.4f p_t30
p-values t(30) = 0.0546
于 2015-03-18T16:03:36.763 回答