Graphics Examples

Example 2 – Connected Plot of Lab Results by Visit

This example shows lab results by visits with lines connected to show the trend for each subject.

  • pageby=specifies by variable(s).
  • v_var = species variable for the y-axis.
  • h_var = specifies variable for the x-axis.
  • id_var=patients generates unique symbol for each patient.
  • interpol=join connects points for individual paients.
  • meanref=V generates a mean reference line for the y-axis.
  • opts=specifies options for the gplot PLOT statement.

*subset limited number of patients for a patient line plot;
data adlb2;
	set adam1.adlbc;
	where paramcd = 'ALB' and avisitn >8 and usubjid in 
	('01-701-1015', '01-701-1023','01-701-1028','01-701-1033','01-701-1034','01-701-1047','01-701-1097','01-701-1111','01-701-1115','01-701-1118',
'01-701-1130','01-701-1133','01-701-1146');
	format avisitn avis.
		sex $sexf.;
	label avisitn = 'Visit';
run;

axis1 label=(a=1 "Value");
%graph3(in=adlb2,
	pageby=param sex,
	v_var=aval,
	h_var=avisitn,
	id_var=usubjid,
	interpol=join,
	meanref=V,
	opts=frame vaxis=axis1);