[S] Problems with GAM using lo(x1,x2)

Richard Tucker (rtucker@www-vdc.fas.harvard.edu)
Sun, 1 Nov 1998 21:54:55 -0500 (EST)


We are doing some GAM analyses in S-Plus (3.4 HP Unix) using the
construction:

mid~lo(tradelo,tradehi) + other variables.

We continually get a negative chi square statistic on the lo(tradelo,tradehi)
term (regardless of permutation) and do worse in terms of residual
deviance than just doing lo(tradelo) + lo(tradehi). We have done this
with many other variables for previous studies and it always worked fine
(at least we never saw a negative chi square before!).

Any suggestions/help will be greatly appreciated.

Thanks in advance for your help.

- Richard Tucker (rtucker@www-vdc.fas.harvard.edu)
- Neal Beck (beck@ucsd.edu)

----------------------------------------------------------------------

Here is the relevant output from the most recent runs:

> summary.gam(gam.tradei3.1)

Call: gam(formula = mid ~ lo(distance) + lo(tradelo) + lo(tradehi) +
democrat + s(py) + lo(degequal), family = binomial, data = jprtri3)

Deviance Residuals:
Min 1Q Median 3Q Max
-0.9582856 -0.2157935 -0.1306208 -0.08815663 4.02166

(Dispersion Parameter for Binomial family taken to be 1 )

Null Deviance: 8047.795 on 30198 degrees of freedom

Residual Deviance: 6247.637 on 30172.86 degrees of freedom

Number of Local Scoring Iterations: 7

DF for Terms and Chi-squares for Nonparametric Effects

Df Npar Df Npar Chisq P(Chi)
(Intercept) 1
lo(distance) 1 3.1 9.8713 0.0216630
lo(tradelo) 1 5.0 18.6490 0.0022401
lo(tradehi) 1 4.7 8.2495 0.1251715
democrat 1
s(py) 1 3.0 262.9459 0.0000000
lo(degequal) 1 3.3 67.8542 0.0000000

> summary.gam(gam.tradei3.2)

Call: gam(formula = mid ~ lo(distance) + lo(tradelo, tradehi, span =
0.75) + democrat + s(py) + lo(degequal), family = binomial, data =
jprtri3)

Deviance Residuals:
Min 1Q Median 3Q Max
-1.80616 -0.2165508 -0.1267971 -0.07977572 4.069385

(Dispersion Parameter for Binomial family taken to be 1 )

Null Deviance: 8047.795 on 30198 degrees of freedom

Residual Deviance: 6400.237 on 30179.18 degrees of freedom

Number of Local Scoring Iterations: 7

DF for Terms and Chi-squares for Nonparametric Effects

Df Npar Df Npar Chisq P(Chi)
(Intercept) 1
lo(distance) 1 3.1 11.4736 0.0103374
lo(tradelo, tradehi, span = 0.75) 2 3.4 -172.9191 1.0000000
democrat 1
s(py) 1 3.0 259.8114 0.0000000
lo(degequal) 1 3.3 48.8148 0.0000000

-----------------------------------------------------------------------
This message was distributed by s-news@wubios.wustl.edu. To unsubscribe
send e-mail to s-news-request@wubios.wustl.edu with the BODY of the
message: unsubscribe s-news