data trout;
infile 'trout.txt' firstobs=2;
input dose dead tested;
dosef = dose; /* 2nd copy of dose used for LOF test */
run;
/* can use either proc logistic, proc probit, or proc genmod */
/* I illustrate genmod */
/* specify response as events/trials */
/* can also include output statement and many bells and whistles */
proc genmod;
model dead/tested = dose / d=binomial;
run;
/* Here's how to include overdispersion, using Pearson Chi2 / residual df */
/* if specify scale = d, will use residual deviance / df, usually very similar */
proc genmod;
model dead/tested = dose / d=binomial scale=p;
run;
/* if have 2 copies of the X variable, can compare regression to means model with one fit */
proc genmod;
class dosef; /* make one copy a class variable */
model dead/tested = dose dosef / d=binomial scale=d type1; /* fit X var first */
run;
/* type1 in model statement asks for sequential tests of each model term */
/* usually would use type3 in a data analysis, but need sequential for the LOF test */