将选项添加type=time
到您的XAXIS
声明中。您还需要使用该values=
选项明确说明要勾选的剂量值。
例子:
proc sgplot data=have;
vline hours /response=value group=dose stat=mean limitstat=stderr;
xaxis label='Hours post dose'
type=time values=(0 to 4,6,8,24) /* added to xaxis statement */
;
yaxis label='Mean +/- SD';
run;
完整示例:
data have;
call streaminit(2021);
do patid = 1 to 500;
dose = int( (patid-1) / (500/4) );
do hours = 0 to 4, 6, 8, 24;
select (dose);
when (0) value = hours/24 * 25;
when (1) value = hours/24 * 45;
when (2) value = ifn (hours<6, hours/6 * 100, 100 - hours/24 * 25);
when (3) value = ifn (hours<6, hours/6 * 250, 250);
otherwise;
end;
base = value;
jitter = rand('uniform') * hours;
value = min(jitter * value, 250);
output;
end;
end;
run;
ods html file='vline.html';
proc sgplot data=have;
vline hours /response=value group=dose stat=mean limitstat=stderr;
xaxis label='Hours post dose' type=time values=(0 to 4,6,8,24);
yaxis label='Mean +/- SD';
run;
ods html close;
生产