BookmarkSubscribeRSS Feed
Toughguy
Calcite | Level 5

Hello everyone,

 

I am new to SAS. I want to assess the association between meat intake and **bleep** quality parameters by using restricted cubic splines in Multivarate Linear Regression. 

 

I used the following syntax for Multivarate Linear Regression.

 

 

%include "F:\sas\nonlinear_curve\RCS_Reg.sas";

%RCS_Reg(infile=fenxi_4_1, Main_spline_var=meat, ref_val=0, typ_reg=lin, dep_var=Log_volu,

Oth_spline_var1=A_age, Oth_spline_var2=BMI, Oth_spline_var3=I_tvdur, Oth_spline_var4=I_pa, Oth_spline_var5=f_en,Oth_spline_var6=factor1, Oth_splinGraph1.pnge_var7=factor2, Oth_spline_var8=factor3, Oth_spline_var9=factor4, Oth_spline_var10=factor5,

adjust_var=O_ad smoke income,

avk_msv=0, knots_msv=5 50 95,x_ref_line=0,y_ref_line=1,specif_val=46.19 130.975 243.14,no_title=1,no_label_x=1,no_label_y=1,no_legend=1,display_knots=1);

quit;

 

Generate "Graph 1" after running.  Y_AXIS list the Log_volu "Difference [95%]" for values of meat.  However, I want see the Y_AXIS that list the values of Log_volu for values of meat in my SAS output. I was wondering if anyone can help me with the syntax.

 

Thank you in advance!

 

1 REPLY 1
SteveDenham
Jade | Level 19

The first question in my mind is about the macro code RCS_Reg.sas. What is going on with it? Without access to that code, I don't see how we can help you accomplish what you want.  Perhaps we could use PROC TPSPLINE, or the EFFECT and EFFECTPLOT commands in one of the PROC's which support them, such as GENMOD. Something like the second example in the EFFECTPLOT documentation might serve as an example.  The reason I am jumping to that example is that you get a plot of the dependent variable as a function of the other variables, rather than a plot of the difference as a function of one of the variables.  The issue with that particular approach is how to deal with the other variables in the model. So, I get to using PROC SGPLOT, with the PBSPLINE statement.  Try something like:

 

proc sgplot data=sashelp.gas;
   pbspline y=log_valu x=meat / nknots=3;
run;

SteveDenham

 

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

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
  • 1 reply
  • 847 views
  • 0 likes
  • 2 in conversation