Statalist The Stata Listserver


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

Re: [SPAM] RE: st: Question regarding linktest and its implementation


From   Richard Williams <[email protected]>
To   [email protected]
Subject   Re: [SPAM] RE: st: Question regarding linktest and its implementation
Date   Sun, 06 Aug 2006 21:12:13 -0500

At 02:33 PM 8/6/2006, Daniel Schneider wrote:
Here is a simple example:
Here is the same thing run in Stata 7. Looks the same to me as your output. So, unless I missed something, if there is an error, it has been around awhile. But perhaps you misunderstand how linktest works, I really don't know myself.

. use "C:\Stata7\auto.dta", clear
(1978 Automobile Data)

. glm price trunk foreign weight,fam(gam)

Iteration 0: log likelihood = -715.70821
Iteration 1: log likelihood = -715.62533
Iteration 2: log likelihood = -715.62504

Generalized linear models No. of obs = 74
Optimization : ML: Newton-Raphson Residual df = 70
Scale param = .0729733
Deviance = 4.436463251 (1/df) Deviance = .063378
Pearson = 5.10813316 (1/df) Pearson = .0729733

Variance function: V(u) = u^2 [Gamma]
Link function : g(u) = 1/u [Reciprocal]
Standard errors : OIM

Log likelihood = -715.6250372 AIC = 19.44933
BIC = -296.8480933

------------------------------------------------------------------------------
price | Coef. Std. Err. z P>|z| [95% Conf. Interval]
-------------+----------------------------------------------------------------
trunk | 1.66e-06 1.65e-06 1.01 0.312 -1.56e-06 4.89e-06
foreign | -.0001001 .0000136 -7.34 0.000 -.0001268 -.0000734
weight | -8.86e-08 9.31e-09 -9.51 0.000 -1.07e-07 -7.03e-08
_cons | .0004541 .0000289 15.72 0.000 .0003974 .0005107
------------------------------------------------------------------------------

.
. predict pr1
(option mu assumed; predicted mean price)

.
. predict pr2,xb

.
. gen pr1sq=pr1^2

.
. gen pr2sq=pr2^2

.
. linktest,fam(gam)

Iteration 1 : deviance = 5.2028
Iteration 2 : deviance = 4.4811
Iteration 3 : deviance = 4.3783
Iteration 4 : deviance = 4.3760
Iteration 5 : deviance = 4.3760
Iteration 6 : deviance = 4.3760

Residual df = 71 No. of obs = 74
Pearson X2 = 5.113241 Deviance = 4.375989
Dispersion = .0720175 Dispersion = .0616336

Gamma distribution, power link (power = -1)
------------------------------------------------------------------------------
price | Coef. Std. Err. z P>|z| [95% Conf. Interval]
-------------+----------------------------------------------------------------
_hat | 1.333585 .3680821 3.62 0.000 .6121571 2.055012
_hatsq | -1117.429 1200.049 -0.93 0.352 -3469.481 1234.624
_cons | -.0000214 .0000261 -0.82 0.412 -.0000726 .0000298
------------------------------------------------------------------------------

.
. glm price pr2 pr2sq,fam(gam)

Iteration 0: log likelihood = -716.00822
Iteration 1: log likelihood = -715.60755
Iteration 2: log likelihood = -715.59485
Iteration 3: log likelihood = -715.5948

Generalized linear models No. of obs = 74
Optimization : ML: Newton-Raphson Residual df = 71
Scale param = .0720172
Deviance = 4.37598887 (1/df) Deviance = .0616336
Pearson = 5.113222128 (1/df) Pearson = .0720172

Variance function: V(u) = u^2 [Gamma]
Link function : g(u) = 1/u [Reciprocal]
Standard errors : OIM

Log likelihood = -715.5948 AIC = 19.42148
BIC = -301.2126327

------------------------------------------------------------------------------
price | Coef. Std. Err. z P>|z| [95% Conf. Interval]
-------------+----------------------------------------------------------------
pr2 | 1.333624 .3679106 3.62 0.000 .6125322 2.054715
pr2sq | -1117.528 1199.493 -0.93 0.352 -3468.491 1233.436
_cons | -.0000214 .0000261 -0.82 0.412 -.0000726 .0000297
------------------------------------------------------------------------------

.
. glm price pr1 pr1sq,fam(gam)

Iteration 0: log likelihood = -715.36138
Iteration 1: log likelihood = -715.26719
Iteration 2: log likelihood = -715.26676

Generalized linear models No. of obs = 74
Optimization : ML: Newton-Raphson Residual df = 71
Scale param = .0599273
Deviance = 3.719899097 (1/df) Deviance = .0523929
Pearson = 4.254836057 (1/df) Pearson = .0599273

Variance function: V(u) = u^2 [Gamma]
Link function : g(u) = 1/u [Reciprocal]
Standard errors : OIM

Log likelihood = -715.2667551 AIC = 19.41262
BIC = -301.8687225

------------------------------------------------------------------------------
price | Coef. Std. Err. z P>|z| [95% Conf. Interval]
-------------+----------------------------------------------------------------
pr1 | -6.17e-08 7.46e-09 -8.27 0.000 -7.63e-08 -4.71e-08
pr1sq | 2.42e-12 3.76e-13 6.44 0.000 1.69e-12 3.16e-12
_cons | .0004557 .0000327 13.92 0.000 .0003916 .0005199
------------------------------------------------------------------------------


-------------------------------------------
Richard Williams, Notre Dame Dept of Sociology
OFFICE: (574)631-6668, (574)631-6463
FAX: (574)288-4373
HOME: (574)289-5227
EMAIL: [email protected]
WWW (personal): http://www.nd.edu/~rwilliam
WWW (department): http://www.nd.edu/~soc
*
* 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