Programming the statistical procedures from SAS

GAM without a strange non-linear component

Reply
Occasional Contributor
Posts: 8

GAM without a strange non-linear component

I submitted proc gam with a non-linear component which has no information on deviation analysis (table on smoothing model analysis), but for DF only. How can I interpret these results ?

 

Respected Advisor
Posts: 2,655

Re: GAM without a strange non-linear component

It would help if you could share the results with the forum, as well as the design and model that you are using.

 

Steve Denham

Occasional Contributor
Posts: 8

Re: GAM without a strange non-linear component

Program is

 

proc gam data=modelo2;
class viv act iess prov gen civil edu trab;
model tipo (event='1')=spline(deuda_6m)
param(viv)param(act)param(iess)param(prov)
param(gen)param(civil)param(edu)param(trab)
/ dist=binomial link=logit maxiter=10000 maxitscore=200000;
output out=result pred linp uclm lclm adiag std;
score data=result out=result;
run;

 

I tried to attach the file sas modelo2, but I was not able. I can send it by email.

 

Table of deviance analysis gives no result, excepting DF. Why ?

 

I found that if the anodev=norefit is included among the options of the sentence model, then a result for this table is obtained.

 

 

 

Respected Advisor
Posts: 2,655

Re: GAM without a strange non-linear component

Give this a try:

 

proc gam data=modelo2;
class viv act iess prov gen civil edu trab;
model tipo (event='1')=spline(deuda_6m) 
param(viv act iess prov gen civil edu trab)
/ dist=binomial link=logit maxiter=10000 maxitscore=200000 anodev=norefit;
output out=result pred linp uclm lclm adiag std;
score data=result out=result;
run;

I don't know whether changing how the class variables enter the model will help or not, but this looks to be "cleaner" code.  Since there is only one smoothing term in the model, the norefit method is probably more appropriate than fitting nested models.

 

The other cause of loss of estimates is an overfitted model, but I don't think that is necessarily the case here.  How many events and nonevents do you have in your data?

 

Steve Denham

Occasional Contributor
Posts: 8

Re: GAM without a strange non-linear component

Yes, the code works OK, excepting the deviance analysis.

 

There are 1815 events and 742 nonevents.

 

Respected Advisor
Posts: 2,655

Re: GAM without a strange non-linear component

I assume that each of your class variables has only two levels, so you have about 10 events per variable.  Overfitting doesn't seem to be the problem then.  I will suppose that the behavior is due to having only a single nonparametric term.

 

And given that, have you considered fitting the following, since the class variables enter parametrically?

 

proc glimmix data=modelo2;
class viv act iess prov gen civil edu trab;
effect deu_spl = spline(deuda_6m); 
model tipo (event='1')=deu_spl viv act iess prov en civil edu trab
/ dist=binomial link=logit maxiter=10000 maxitscore=200000 solution;
run;

Check if this runs for your data, and whether there is an ANOVA table and solution estimates.

 

Steve Denham

SAS Super FREQ
Posts: 3,547

Re: GAM without a strange non-linear component

Building on Steve's response, PROC LOGISTIC also supports the EFFECT statement. Since your model does not have random effects, I'd try LOGISTIC if you decide to pursue this alternative.

Occasional Contributor
Posts: 8

Re: GAM without a strange non-linear component

Most of variables has two levels.

 

It seems that SAS discretizes deu_spl (it appeared 7 levels), if it does, how are built those levels ?

 

Also, now there are results for Type III Tests of Fixed Effects.

 

Respected Advisor
Posts: 2,655

Re: GAM without a strange non-linear component

Well, those 7 levels are the knots for the spline.  You can specify other values in the effect statement, but that should work.  Also, @Rick_SAS suggested PROC LOGISTIC as also supporting the EFFECT statement, so you may want to port to that, especially if you are interested in scoring.

 

Steve Denham

Ask a Question
Discussion stats
  • 8 replies
  • 361 views
  • 1 like
  • 3 in conversation