useful codes

1. Cumstomize SAS sgplot points and linecolors using modstyle macro:

data iris;

input SepalLength SepalWidth PetalLength PetalWidth

Species @@;

label SepalLength='Sepal Length in mm.'

SepalWidth ='Sepal Width in mm.'

PetalLength='Petal Length in mm.'

PetalWidth ='Petal Width in mm.';

datalines;

50 33 14 02 1 64 28 56 22 3 65 28 46 15 2 67 31 56 24 3

63 28 51 15 3 46 34 14 03 1 69 31 51 23 3 62 22 45 15 2

59 32 48 18 2 46 36 10 02 1 61 30 46 14 2 60 27 51 16 2

63 33 60 25 3 53 37 15 02 1

;

proc sort data=iris;by Species;run;

%modstyle(name=markstyle, parent=statistical, type=CLM,

markers=circlefilled trianglefilled plus);

ODS GRAPHICS / RESET IMAGENAME = 'exampleplot' IMAGEFMT =PNG HEIGHT = 5in WIDTH = 5in;

ods listing style=markstyle gpath="C:\Users\leeseon\Documents";

proc sgplot data=iris ;

reg x=SepalLength y=SepalWidth/group=Species lineattrs=(thickness=8) markerattrs=(size=10) ;

run;

2. Heterogeneous variance for mixed effect model

data absorb;

input group FatType Absorbed @@;

datalines;

1 1 164 1 1 172 1 1 168 2 1 177 2 1 156 2 1 195

1 2 178 1 2 191 1 2 197 2 2 182 2 2 185 2 2 177

1 3 175 1 3 193 1 3 178 2 3 171 2 3 163 2 3 176

1 4 155 1 4 166 1 4 149 2 4 164 2 4 170 2 4 168

;

ods graphics on;

proc mixed data=absorb asycov;

class FatType group;

model Absorbed = FatType|group / s

influence(iter=10 estimates);

repeated / group=FatType type=UN;

ods output Influence=inf;

run;

ods graphics off;