本人第一次用SAS编程,做了3周了,下面的程序是统计分析最后的一段了,但是出问题了,实在想不出原因,麻烦各位帮忙看看。
赋值
%let samplesize=3000; %let groups=298;
%let gama00_hat=5091.25; %let gama01_hat=3002.76; %let gama02_hat=1200.02;%let gama03_hat=3456.93;
%let gama40_hat=773.48; %let gama41_hat=-837.86; %let gama42_hat=-748.40; %let gama43_hat=1339.29;
%let gama50_hat=7668.16; %let gama51_hat=6169.1; %let gama52_hat=8481.79; %let gama53_hat=-2298.41;
%let gama60_hat=2361.84; %let gama61_hat=1150.01; %let gama62_hat=1853.28; %let gama63_hat=-2032.24;
%let gama80_hat=406.75; %let gama81_hat=293.52; %let gama82_hat=-193.78; %let gama83_hat=-255.55;
%let beta1_hat=-67.9889; %let beta2_hat=-369.49; %let beta3_hat=-648.17;
程序
proc sql;
create table data100 as select w1,w2,w3,country from sasuser.stand order by country;
create table sasuser.data_level_2 as select distinct country,w1=1 as w1,w2=1 as w2, w3=1 as w3 from sasuser.stand;
quit;
宏程序
%macro ml_bootstrap;
%do sample=1 %to 100;
%put samp=&sample;
proc surveyselect out=data1 data=sasuser.new_level_1_resd method=URS n=&samplesize outhits noprint;
data newdata1;
merge data1 sasuser.stand1;
proc surveyselect out=data2 data=sasuser.new_level_2_resd method=URS n=&groups outhits noprint;
data newdata2;
merge data2 sasuser.data_level_2;
new_alpha=&gama00_hat+&gama01_hat*w1+&gama02_hat*w2+&gama03_hat*w3+new_u0;
new_beta4=&gama40_hat+&gama41_hat*w1+&gama42_hat*w2+&gama43_hat*w3+new_u1;
new_beta5=&gama50_hat+&gama51_hat*w1+&gama52_hat*w2+&gama53_hat*w3+new_u2;
new_beta6=&gama60_hat+&gama61_hat*w1+&gama62_hat*w2+&gama63_hat*w3+new_u3;
new_beta8=&gama80_hat+&gama81_hat*w1+&gama82_hat*w2+&gama83_hat*w3+new_u5;
data bootstrap_data (keep=country new_y1 new_alpha new_beta4 new_beta5 new_beta6 new_beta8 x1 x2 x3 x4 x5 x6 x8 w1 w2 w3 new_resd_1);
merge newdata1 newdata2; by country;
new_y1=new_alpha+new_beta4*x4+new_beta5*x5+new_beta6*x6+new_beta8*x8+&beta1_hat*x1+&beta2_hat*x2+&beta3_hat*x3+new_resd_1;
proc mixed method=reml noinfo noitprint covtest;
class country;
model new_y1=w1|x4 w1|x5 w1|x6 w1|x8 w2|x4 w2|x5 w2|x6 w2|x8 w3|x4 w3|x5 w3|x6 w3|x8 x1 x2 x3
/solution ddfm=bw notest outp=predicted;
random int x4 x5 x6 x8/solution type=un subject=country;
ods output solutionf=reg_coef covparms=resd_cov;
run;
%put &syslast;
%if &syslast=work.reg_coef %then %do; 请问这句程序是什么意思?&syslast是个什么变量?
proc transpose data=reg_coef out=fixed_p; var estimate; id effect; 这句程序没有运行,什么原因呢?