BookmarkSubscribeRSS Feed
mcadena
Calcite | Level 5

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 ?

 

8 REPLIES 8
SteveDenham
Jade | Level 19

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

mcadena
Calcite | Level 5

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.

 

 

 

SteveDenham
Jade | Level 19

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

mcadena
Calcite | Level 5

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

 

There are 1815 events and 742 nonevents.

 

SteveDenham
Jade | Level 19

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

Rick_SAS
SAS Super FREQ

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.

mcadena
Calcite | Level 5

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.

 

SteveDenham
Jade | Level 19

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

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

What is ANOVA?

ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 8 replies
  • 1698 views
  • 1 like
  • 3 in conversation