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;

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

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
  • 4086 views
  • 1 like
  • 2 in conversation