data example10_3;
input vas1-vas3;
cards;
7	8	6
4	4	3
5	5	4
6	6	5
4	4	1
6	6	5
6	6	6
8	7	7
4	4	4
8	7	3
7	7	4
7	6	6
7	6	5
6	5	4
7	6	6
5	4	5
6	5	3
6	6	5
7	6	6
8	7	5
;
proc glm;
model vas1-vas3=/nouni;
repeated time 3 contrast(1)/printe summary printh;
run;
proc glm;
model vas1-vas3=/nouni;
repeated time 3 polynomial/printe summary printh;
run;

/*利用sgplot过程绘制线图，首先将数据转换为每一时间点一行，增加时间变量t，分析变量v，然后绘制v随t变化的线图*/
data lineplot;
set example10_3;
array vas[3];    
do t=1 to 3;
v=vas[t];
output;
end;
keep t v;
run;
proc sgplot data=lineplot;
vline t/response=v markers stat=mean;
xaxis label="观测时间";         
yaxis label="VAS评分" values=(0 to 7);             
run;


