Skip to content

Instantly share code, notes, and snippets.

@zhanglianbo35
Created March 20, 2019 17:49
Show Gist options
  • Save zhanglianbo35/b06e6e3f34ea8fcd124daa4fbdd909b6 to your computer and use it in GitHub Desktop.
Save zhanglianbo35/b06e6e3f34ea8fcd124daa4fbdd909b6 to your computer and use it in GitHub Desktop.
two side Anova Page 106
data hgbds;
input trt $ type $ patno hgbch @@;
datalines;
ACT C 1 1.7 ACT C 3 -0.2 ACT C 6 1.7
ACT C 7 2.3 ACT C 10 2.7 ACT C 12 0.4
ACT C 13 1.3 ACT C 15 0.6 ACT P 22 2.7
ACT P 24 1.6 ACT P 26 2.5 ACT P 28 0.5
ACT P 29 2.6 ACT P 31 3.7 ACT P 34 2.7
ACT P 36 1.3 ACT R 42 -0.3 ACT R 45 1.9
ACT R 46 1.7 ACT R 47 0.5 ACT R 49 2.1
ACT R 51 -0.4 ACT R 52 0.1 ACT R 54 1.0
PBO C 2 2.3 PBO C 4 1.2 PBO C 5 -0.6
PBO C 8 1.3 PBO C 9 -1.1 PBO C 11 1.6
PBO C 14 -0.2 PBO C 16 1.9 PBO P 21 0.6
PBO P 23 1.7 PBO P 25 0.8 PBO P 27 1.7
PBO P 30 1.4 PBO P 32 0.7 PBO P 33 0.8
PBO P 35 1.5 PBO R 41 1.6 PBO R 43 -2.2
PBO R 44 1.9 PBO R 48 -1.6 PBO R 50 0.8
PBO R 53 -0.9 PBO R 55 1.5 PBO R 56 2.1
;
proc format;
value $typfmt 'C' = 'CERVICAL '
'P' = 'PROSTATE '
'R' = 'COLORECTAL' ;
run;
proc sort data = hgbds;
by trt type;
proc means mean std n;
var hgbch;
by trt type;
format type $typfmt.;
title1 'Two-Way ANOVA';
title2 'EXAMPLE 7.1: Hemoglobin Changes in Anemia';
run;
proc glm data = hgbds;
class trt type;
model hgbch = trt type trt*type / ss3;
lsmeans type / pdiff stderr t lines;
format type $typfmt.;
run;
quit;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment