Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: AW: st: Confidence interval for the coefficients
From
Thomas Speidel <[email protected]>
To
[email protected]
Subject
Re: AW: st: Confidence interval for the coefficients
Date
Tue, 27 Jul 2010 10:26:26 -0600
Thanks Martin and Michael.
Quoting Martin Weiss <[email protected]> Tue 27 Jul 10:13:05 2010:
<>
" Your code is perfect, except in one respect. The confidence interval is
based on a -t-
distribution and not a -z- distribution."
But even if we accepted the -normal- as an approximation to the
t-distribution, Thomas could improve on his ballpark "1.96" via
*************
di invnormal(.975)
*************
HTH
Martin
-----Ursprüngliche Nachricht-----
Von: [email protected]
[mailto:[email protected]] Im Auftrag von Michael N.
Mitchell
Gesendet: Dienstag, 27. Juli 2010 18:09
An: [email protected]
Betreff: Re: st: Confidence interval for the coefficients
Dear Thomas
Your code is perfect, except in one respect. The confidence interval is
based on a -t-
distribution and not a -z- distribution. So, the -t- value in this case
would be
. di invttail(72,0.025)
1.9934636
Instead of 1.96. Substituting that into your code gives the desired
results...
. sysuse auto, clear
(1978 Automobile Data)
. reg mpg weight
Source | SS df MS Number of obs =
74
-------------+------------------------------ F( 1, 72) =
134.62
Model | 1591.9902 1 1591.9902 Prob > F =
0.0000
Residual | 851.469256 72 11.8259619 R-squared =
0.6515
-------------+------------------------------ Adj R-squared =
0.6467
Total | 2443.45946 73 33.4720474 Root MSE =
3.4389
----------------------------------------------------------------------------
--
mpg | Coef. Std. Err. t P>|t| [95% Conf.
Interval]
-------------+--------------------------------------------------------------
--
weight | -.0060087 .0005179 -11.60 0.000 -.0070411
-.0049763
_cons | 39.44028 1.614003 24.44 0.000 36.22283
42.65774
----------------------------------------------------------------------------
--
.
. di _b[weight] - invttail(72,0.025) * _se[weight]
-.00704106
. di _b[weight] + invttail(72,0.025) * _se[weight]
-.00497632
Best regards,
Michael N. Mitchell
Data Management Using Stata - http://www.stata.com/bookstore/dmus.html
A Visual Guide to Stata Graphics - http://www.stata.com/bookstore/vgsg.html
Stata tidbit of the week - http://www.MichaelNormanMitchell.com
On 2010-07-27 8.54 AM, Thomas Speidel wrote:
I am sure this has been asked before, but my search did not reveal any
hits in the archive. Why is the following happening:
. sysuse auto, clear
. reg mpg weight
Source | SS df MS Number of obs = 74
-------------+------------------------------ F( 1, 72) = 134.62
Model | 1591.9902 1 1591.9902 Prob > F = 0.0000
Residual | 851.469256 72 11.8259619 R-squared = 0.6515
-------------+------------------------------ Adj R-squared = 0.6467
Total | 2443.45946 73 33.4720474 Root MSE = 3.4389
----------------------------------------------------------------------------
--
mpg | Coef. Std. Err. t P>|t| [95% Conf. Interval]
-------------+--------------------------------------------------------------
--
weight | -.0060087 .0005179 -11.60 0.000 -.0070411 -.0049763
_cons | 39.44028 1.614003 24.44 0.000 36.22283 42.65774
----------------------------------------------------------------------------
--
. di _b[weight] - 1.96 * _se[weight]
-.00702373
. di _b[weight] + 1.96 * _se[weight]
-.00499365
Why -.00702373 != -.0070411 and -.00499365 != -.0049763 ? Rounding off
error/computer precision? --
Thomas Speidel
*
* 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/
*
* 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/
*
* 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/
--
Thomas Speidel
*
* 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/