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

I wish to ask if any can help correct the bold section of the code below????

THANKS

Data sim;

Input A B;

cards;

1 3

2 7

3 10

4 12

;

Run;

proc iml;

use sim;

read all  var{A B} into DM;

close;

A = DM[,1]; B = DM[,2];

n = nrow(DM);

start Func(x);

   return(  exp(2-x)#[cdf("Normal", x-10)-cdf("Normal", x-4)]*exp(-x) );

finish;

answer = j(nrow(DM),1);

do i = 1 to nrow(DM);

call quad(result, "Func", A || B,);

answer = result;

end;

create kaplan1n var{A  B Answer };

append;

quit;

1 ACCEPTED SOLUTION

Accepted Solutions
desireatem
Pyrite | Level 9

I see, This works,

Data sim;

Input A B;

cards;

1 3

2 7

3 10

4 12

;

Run;

proc iml;

use sim;

read all  var{A B} into DM;

close;

A = DM[,1]; B = DM[,2];

n = nrow(DM);

start Func(x);

   return(  exp(2-x)#(cdf("Normal", x-10)-cdf("Normal", x-4))*exp(-x) );

finish;

answer = j(nrow(DM),1);

do i = 1 to nrow(DM);

call quad(result, "Func", A || B,);

answer = result;

end;

create kaplan1n var{A  B Answer };

append;

quit;

View solution in original post

3 REPLIES 3
desireatem
Pyrite | Level 9

I see, This works,

Data sim;

Input A B;

cards;

1 3

2 7

3 10

4 12

;

Run;

proc iml;

use sim;

read all  var{A B} into DM;

close;

A = DM[,1]; B = DM[,2];

n = nrow(DM);

start Func(x);

   return(  exp(2-x)#(cdf("Normal", x-10)-cdf("Normal", x-4))*exp(-x) );

finish;

answer = j(nrow(DM),1);

do i = 1 to nrow(DM);

call quad(result, "Func", A || B,);

answer = result;

end;

create kaplan1n var{A  B Answer };

append;

quit;

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
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
  • 3 replies
  • 3917 views
  • 1 like
  • 2 in conversation