Hello Doc Wicklin, I was just reading your artical http://blogs.sas.com/content/iml/2011/10/12/maximum-likelihood-estimation-in-sasiml.html, and it has been extremely helpful. This is my data generating code. data q1;
call streaminit(1024);
do i = 1 to 1000;
z = rand("Normal", 0, 2);
v = rand("Normal", 0, 1);
if 2-z> v then d = 1;
else d = 0;
a = 1;
output;
end;
run; I fixed the typo and the same error remains. proc iml;
start loglik(param) global (x);
x1 = x[,{1 2}];
x3 = x[,3];
pr = cdf("normal",x1*t(param));
pr2 = 1 - pr;
f = -sum(t(x3)*log(pr)+t(1-x3)*log(pr2));
return ( f );
finish; the call code is the following: proc iml;
use q1;
read all var {a z d} into x;
close q1;
con = { . ., . .};
p = {-10 -10};
opt = {1,4};
call nlpnra(rc, result, "loglik", p, opt, con); Again, thank you very much for your help. Since I am extremely new to sas, i might make very stupid mistakes. Yours, Frank
... View more