BookmarkSubscribeRSS Feed
JerryLee
Calcite | Level 5

I know how to define the first function, like

start f(x);

a=x[1];b=x[2];c=x[3];

f1=a complex expression involving a,b and c;

return(f1);

finish f;

What if I want to define another function g(z), where z=(x[1],x[2]) a subvector of x, such that g(z)=f(x[1],x[2],x[3]=4)? Is there a simple way to do it in IML? Thanks.

1 REPLY 1
Rick_SAS
SAS Super FREQ

start f1(a,b,c);

   f1=a complex expression involving a,b and c;

   return(f1);

finish f1;

start f(x);

return( f1(x[1], x[2], x[3]) );

finish f;

start g(x);

return( f1(x[1], x[2], 4) );

finish f;

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!

Multiple Linear Regression in SAS

Learn how to run multiple linear regression models with and without interactions, presented by SAS user Alex Chaplin.

Find more tutorials on the SAS Users YouTube channel.

From The DO Loop
Want more? Visit our blog for more articles like these.
Discussion stats
  • 1 reply
  • 748 views
  • 0 likes
  • 2 in conversation