- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
I am not familiar with the spline procedures. The goal I intend to achieve is to draw a spline-line graph, with a response variable as the Y-axis together with its confidence interval, and an independent variable as the X-axis changes continuously. However, the model has more than one independent variable. So, where should I start from scratch? Thank you.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
PROC ADAPTIVEREG will get you started. This simple example should help ODS Graphics and PROC ADAPTIVEREG
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Hello, everyone
Today I learned the PROC TRANSREG could be used to draw spline, e.g.,
ods graphics on; proc transreg data=d202ps_4; model identity(addMg) = spline(serumAlb); run;
However, my linear regression model should include many other independent variables. I tried to add them to the PROC TRANSREG but it did not work as I expected. Does anyone know how to solve this issue (spline with other variables adjusted)?
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Check @Rick_SAS 's blogs:
https://blogs.sas.com/content/iml/2020/06/08/interactions-spline-regression.html
https://blogs.sas.com/content/iml/2016/06/22/sas-effectplot-statement.html
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Hmmm, thanks. The EFFECTPLOT statement is powerful. However, I don't understand one thing.
proc logistic data=d202ps_3; class obesity_status(REF='0') genderC(REF='0') AF(REF='0') Hypertension(REF='0') CHF(REF='0') akiC(ref='0') ddiC(REF='0') indicationC(REF='0') CYP2C9code(REF='0') VKORC1Code(REF='0'); model firstInrAttain(event='1') = obesity_status Weight__kg_ ageY genderC AF Hypertension CHF serumAlb akiC ddiC indicationC CYP2C9code VKORC1Code / clodds=both clparm=both; effectplot slicefit(x=ageY sliceby=obesity_status=0 1 2) / clm noobs; run;
and
proc logistic data=d202ps_3; class /*obesity_status(REF='0')*/ genderC(REF='0') AF(REF='0') Hypertension(REF='0') CHF(REF='0') akiC(ref='0') ddiC(REF='0') indicationC(REF='0') CYP2C9code(REF='0') VKORC1Code(REF='0'); model firstInrAttain(event='1') = obesity_status Weight__kg_ ageY genderC AF Hypertension CHF serumAlb akiC ddiC indicationC CYP2C9code VKORC1Code / clodds=both clparm=both; effectplot slicefit(x=ageY sliceby=obesity_status=0 1 2) / clm noobs; run;
The two produced obviously different graphs. The only difference in the code is whether obesity_status was listed as class/category variable. Also, if I treat obesity_status as a class variable, I cannot define its levels in the EFFECTPLOT analysis (i.e., it has 4 levels but I prefer to use only three levels.) Thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
That would lead you to a different design matrix,
Therefore, you can not expect they have the same graphs(the Predictive Value is changed).
"Also, if I treat obesity_status as a class variable, I cannot define its levels in the EFFECTPLOT analysis"
Maybe @Rick_SAS could give you the right answer .
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
See this doc example: PROC LOGISTIC EFFECTPLOT Statement with CLASS variable . This shows how to use a CLASS variable as the SLICEBY= effect on the EFFETPLOT statement. You do not specify the levels of the CLASS effect here.