BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
pm68
Fluorite | Level 6

Hi,

 

I am using PROC GAMPL to perform GAM analyses, in which I am mixing spline() and param() effects. I am looking for a way to get the covariance matrix of the parameter estimates for additional calculations, but I could not find how to do that. For GLM analyses performed with PROC GENMOD, the covariance matrix may be retrieved by requesting the covB table with the ods output statement. Is there not an equivalent way to proceed with PROC GAMPL?

 

Thanks in advance for your help

1 ACCEPTED SOLUTION

Accepted Solutions
StatDave
SAS Super FREQ

As noted in the list of Frequently Asked-for Statistics (FASTats) in the Important Links section of the Statistical Procedures Community page, the Tweedie distribution is available in GENMOD and HPGENSELECT, but these do not offer the EFFECT statement (the Tweedie is also available in some procedures in SAS Viya). One way around this is to use a procedure that supports the EFFECT statement to build and save the design matrix columns needed for your model and then use them as input in GENMOD or HPGENSELECT to fit your Tweedie model. PROC LOGISTIC can do that by using the OUTDESIGN= and OUTDESIGNONLY options (see this note). For example, these statements create a data set, OD, that contains the design matrix containing columns for the spline effect on the variable BLAST. It then uses those columns (SB: is shorthand for all variables starting with SB) in the model. 

proc logistic data=remiss outdesign=od outdesignonly;
effect sb=spline(blast/naturalcubic);
model infil = smear sb ;
run;
proc genmod data=od;
model infil = smear sb: / dist=tweedie;
run;

View solution in original post

4 REPLIES 4
StatDave
SAS Super FREQ

Instead of using GAMPL, consider using a modeling procedure that offers the EFFECT statement (GLIMMIX, LOGISTIC, ORTHOREG, and others) which can add spline effects to your model. You could then use the COVB (or other option depending on the procedure) to display and/or save the parameter covariance matrix. Or use the STORE statement in the procedure (if available) to save the model and then use PROC PLM to test additional hypotheses.

pm68
Fluorite | Level 6
Hi StatDave,

Thanks for your quick answer and for drawing my attention on these
procedures; I did not realize these could add spline effects.
Unfortunately, I am exploring models with Tweedie distributions (I
should probably have stated this earlier), and I do not think any of
these procedures can accomodate this?
StatDave
SAS Super FREQ

As noted in the list of Frequently Asked-for Statistics (FASTats) in the Important Links section of the Statistical Procedures Community page, the Tweedie distribution is available in GENMOD and HPGENSELECT, but these do not offer the EFFECT statement (the Tweedie is also available in some procedures in SAS Viya). One way around this is to use a procedure that supports the EFFECT statement to build and save the design matrix columns needed for your model and then use them as input in GENMOD or HPGENSELECT to fit your Tweedie model. PROC LOGISTIC can do that by using the OUTDESIGN= and OUTDESIGNONLY options (see this note). For example, these statements create a data set, OD, that contains the design matrix containing columns for the spline effect on the variable BLAST. It then uses those columns (SB: is shorthand for all variables starting with SB) in the model. 

proc logistic data=remiss outdesign=od outdesignonly;
effect sb=spline(blast/naturalcubic);
model infil = smear sb ;
run;
proc genmod data=od;
model infil = smear sb: / dist=tweedie;
run;
pm68
Fluorite | Level 6

Thanks very much StatDave, it seems to work!

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

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
  • 4 replies
  • 617 views
  • 1 like
  • 2 in conversation