在用SAS做多水平模型,参考王济川《多层统计分析模型》一书的程序,但是结果一直出错,麻烦各位帮忙看一下:
赋值
%let c11=15440898; %let c12=1214053; %let c13=28629633; %let c14=10549932; %let c15=2781941; %let c16=59966;
%let c21=1214053; %let c22=7074056; %let c23=-1.456e8; %let c24=-5720831; %let c25=-208604; %let c26=-181805;
%let c31=28629633; %let c32=-1.456e8; %let c33=3.4837e8; %let c34=2467840; %let c35=-1624589; %let c36=6741274;
%let c41=10549932; %let c42=-5720831; %let c43=2467840; %let c44=34762183; %let c45=-1816935; %let c46=2096463;
%let c51=2781941; %let c52=-208604; %let c53=-1624589; %let c54=-1816935; %let c55=3112999; %let c56=-756615;
%let c61=59966; %let c62=-181805; %let c63=6741274; %let c64=2096463; %let c65=-756615; %let c66=1684279;
程序
proc iml;
reset print;
use rescaled_u;
read all var{c_u0 c_u1 c_u2 c_u3 c_u4 c_u5} into c_u;
s=((c_u`) * c_u)/298;
ls=(root(s))`;
sigma={&c11 &c12 &c13 &c14 &c15 &c16,
&c21 &c22 &c23 &c24 &c25 &c26,
&c31 &c32 &c33 &c34 &c35 &c36,
&c41 &c42 &c43 &c44 &c45 &c46,
&c51 &c52 &c53 &c54 &c55 &c56,
&c61 &c62 &c63 &c64 &c65 &c66};
lsigma=(root(sigma))`;
sigma2=lsigma*lsigma`;
a=(lsigma*inv(ls))`;
newu=c_u*a;
s1=((newu`)*newu)/298;
col={"new_u0" "new_u1" "new_u2" "new_u3" "new_u4" "new_u5"};
create sasuser.new_levlel_2_resd from newu [colname=col];
append from newu;
quit;
proc means data=sasuser.new_level_2_resd;
run;
错误提示
lsigma=(root(sigma))`;
ERROR: (execution) Matrix should be positive definite.