admin管理员组文章数量:1313273
I am trying to create a funnel plot in SAS based upon a mean attached to a person. I have looked up and emulated funnel plot code but am getting an error message that I cannot understand regardless of what I look up.
Here is some sample data:
data test_00;
input Name$ avg;
datalines;
Greg 4
Jess 5
Jimmy 5
Sandra 1
Maddie 3
Kyle 2
Eric 5
;
run;
Here is the code I am attempting to run to prepare for the funnel plot:
proc iml;
use test_00;
read all var {name avg};
close test_00;
u=unique(name);
p=ncol(u);
mean= j(p,1); sem= j(p,1); n= j(p,1);
do i= 1 to p;
idx= loc(name=u[i]);
n[i]=ncol(idx);
M = avg[idx];
mean[i]=mean(M);
sem[i]= sqrt(var(M)/n[i]);
end;
y=avg[:];
s=sqrt(var(avg));
print y s[label="StDev"];
n = M( do(0, 50, 1) );
p = {0.001 0.025 0.975 0.999};
z = quantile("normal", p);
limits = y + s / sqrt(n) * z;
I get the following error after running the above code:
ERROR: Invocation of unresolved module M.
statement : ASSIGN at line 1644 column 1
I am confused by this because M is a variable that is created within the DO loop and not a module.
Thank you in advance for helping me through this
本文标签: imlCreate Funnel Plot in SASStack Overflow
版权声明:本文标题:iml - Create Funnel Plot in SAS - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741946563a2406450.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论