BookmarkSubscribeRSS Feed
TomHsiung
Quartz | Level 8

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.

6 REPLIES 6
StatsMan
SAS Super FREQ

PROC ADAPTIVEREG will get you started. This simple example should help ODS Graphics and PROC ADAPTIVEREG 

TomHsiung
Quartz | Level 8

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

TomHsiung
Quartz | Level 8

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.

Ksharp
Super User
"The only difference in the code is whether obesity_status was listed as class/category variable. "
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 .
StatsMan
SAS Super FREQ

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. 

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
  • 6 replies
  • 669 views
  • 10 likes
  • 3 in conversation