after writing the below code, I am trying to write the code as a function in the next code but I receive errors what am I doing wronging?
proc iml;
mean_1 = 268.1; print mean_1;
mean_2 = 384.4; print mean_2;
s_1=124.8; print s_1;
s_2=168; print s_2;
s_pooled = sqrt((s_1**2 + s_2**2)/2);
print(s_pooled);
md =mean_1 - mean_2;print md;
d=abs(md)/s_pooled;
print(d);
quit;
proc iml;
start cohen.d (s_1, s_2, mean_1, mean_2);
s_pooled = sqrt((s_1**2 + s_2**2)/2);
md = mean_1 - mean_2;
return (abs(md)/s_pooled);
finish cohen.d;
print (cohen.d (124.8, 168.3, 268.1, 384.4))
quit;