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

Hi all,  

I want to graph the spline functions, so I create a data set to store spline basis functions, and I got the data set that is below. The issue is when I want to call the spl1-spl4 variables (In the data set appear like spl 1 spl 2 spl 3 and spl 4). The program doesn't recognize any form to call them (nor spl 1 spl 2 spl 3 spl4 neither spl_1 spl_2 spl_3 spl_4).  Can anyone help me?


/* Create SplineBasis = data set that contains spline basis functions */ proc glmselect data=merged0811dersesdiet outdesign(addinputvars fullmodel)=SplineBasis; effect spl = spline(lactationbypar / naturalcubic basis=tpf(noint) knotmethod=percentiles(5)); model weightchange2 = spl / selection=none; quit; proc sgplot data=SplineBasis; series x=lactationbypar y=spl1; series x=lactationbypar y=spl2; series x=lactationbypar y=spl3; series x=lactationbypar y=spl4; run;

 

Screenshot 2017-07-26 17.04.47(2).png

Thanks, 

1 ACCEPTED SOLUTION

Accepted Solutions
Reeza
Super User

Run a proc contents and verify the variable name and label. You need the name. If the name happens to have spaces, then wrap it in qutoes and add an N at the end.

 

'SP 1'n

@mmazariegos wrote:

Hi all,  

I want to graph the spline functions, so I create a data set to store spline basis functions, and I got the data set that is below. The issue is when I want to call the spl1-spl4 variables (In the data set appear like spl 1 spl 2 spl 3 and spl 4). The program doesn't recognize any form to call them (nor spl 1 spl 2 spl 3 spl4 neither spl_1 spl_2 spl_3 spl_4).  Can anyone help me?


/* Create SplineBasis = data set that contains spline basis functions */ proc glmselect data=merged0811dersesdiet outdesign(addinputvars fullmodel)=SplineBasis; effect spl = spline(lactationbypar / naturalcubic basis=tpf(noint) knotmethod=percentiles(5)); model weightchange2 = spl / selection=none; quit; proc sgplot data=SplineBasis; series x=lactationbypar y=spl1; series x=lactationbypar y=spl2; series x=lactationbypar y=spl3; series x=lactationbypar y=spl4; run;

 

Screenshot 2017-07-26 17.04.47(2).png

Thanks, 



 

View solution in original post

2 REPLIES 2
Reeza
Super User

Run a proc contents and verify the variable name and label. You need the name. If the name happens to have spaces, then wrap it in qutoes and add an N at the end.

 

'SP 1'n

@mmazariegos wrote:

Hi all,  

I want to graph the spline functions, so I create a data set to store spline basis functions, and I got the data set that is below. The issue is when I want to call the spl1-spl4 variables (In the data set appear like spl 1 spl 2 spl 3 and spl 4). The program doesn't recognize any form to call them (nor spl 1 spl 2 spl 3 spl4 neither spl_1 spl_2 spl_3 spl_4).  Can anyone help me?


/* Create SplineBasis = data set that contains spline basis functions */ proc glmselect data=merged0811dersesdiet outdesign(addinputvars fullmodel)=SplineBasis; effect spl = spline(lactationbypar / naturalcubic basis=tpf(noint) knotmethod=percentiles(5)); model weightchange2 = spl / selection=none; quit; proc sgplot data=SplineBasis; series x=lactationbypar y=spl1; series x=lactationbypar y=spl2; series x=lactationbypar y=spl3; series x=lactationbypar y=spl4; run;

 

Screenshot 2017-07-26 17.04.47(2).png

Thanks, 



 

mmazariegos
Fluorite | Level 6

Thank you very much Reeza, It works!

'spl 1'n

 

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!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 2 replies
  • 1694 views
  • 0 likes
  • 2 in conversation