*** baseline-category logit models for categorical factors;

data alligator2;

input lake $ size $ food $ count @@;

datalines;

H small fish 23 H small invt 4 H small rept 2 H small bird 2 H small othr 8

H big fish 7 H big invt 0 H big rept 1 H big bird 3 H big othr 5

O small fish 5 O small invt 11 O small rept 1 O small bird 0 O small othr 3

O big fish 13 O big invt 8 O big rept 6 O big bird 1 O big othr 0

T small fish 5 T small invt 11 T small rept 2 T small bird 1 T small othr 5

T big fish 8 T big invt 7 T big rept 6 T big bird 3 T big othr 5

G small fish 16 G small invt 19 G small rept 1 G small bird 2 G small othr 3

G big fish 17 G big invt 1 G big rept 0 G big bird 1 G big othr 3

;

proc print data=alligator2 noobs;

run;

proc logistic data=alligator2;

class lake size food /param=ref;

freq count;

model food(order=data)= lake|size/ link=glogit;

run;

proc logistic data=alligator2;

class lake size/param=ref;

freq count;

model food(order=data)= lake size/ link=glogit;

output out=fits pred=fitted_p;

run;

proc print data=fits;

run;

Output for (lake*size):

Type 3 Analysis of Effects

Wald

Effect DF Chi-Square Pr > ChiSq

lake 12 18.6397 0.0976

size 4 3.9439 0.4137

lake*size 12 6.2811 0.9013

Output for (lake + size):

Analysis of Maximum Likelihood Estimates

Standard Wald

Parameter food DF Estimate Error Chi-Square Pr > ChiSq

Intercept fish 1 0.0564 0.5022 0.0126 0.9107

Intercept invt 1 1.0875 0.4700 5.3530 0.0207

Intercept rept 1 -0.6742 0.6506 1.0739 0.3001

Intercept bird 1 -1.5796 0.7926 3.9717 0.0463

lake G fish 1 1.5164 0.6214 5.9541 0.0147

lake G invt 1 0.3944 0.6263 0.3965 0.5289

lake G rept 1 -1.4183 1.1890 1.4229 0.2329

lake G bird 1 0.4286 0.9383 0.2087 0.6478

lake H fish 1 0.6902 0.5597 1.5207 0.2175

lake H invt 1 -2.0901 0.7184 8.4653 0.0036

lake H rept 1 -1.0023 0.8297 1.4593 0.2270

lake H bird 1 0.2975 0.8342 0.1272 0.7214

lake O fish 1 1.5107 0.7532 4.0229 0.0449

lake O invt 1 1.3260 0.7468 3.1527 0.0758

lake O rept 1 1.0343 0.8402 1.5154 0.2183

lake O bird 1 -0.2303 1.3005 0.0313 0.8595

size big fish 1 0.3316 0.4483 0.5471 0.4595

size big invt 1 -1.1267 0.5049 4.9790 0.0257

size big rept 1 0.6828 0.6514 1.0988 0.2945

size big bird 1 0.9622 0.7127 1.8227 0.1770

Odds Ratio Estimates

Point 95% Wald

Effect food Estimate Confidence Limits

lake G vs T fish 4.556 1.348 15.400

lake G vs T invt 1.483 0.435 5.063

lake G vs T rept 0.242 0.024 2.489

lake G vs T bird 1.535 0.244 9.657

lake H vs T fish 1.994 0.666 5.972

lake H vs T invt 0.124 0.030 0.506

lake H vs T rept 0.367 0.072 1.866

lake H vs T bird 1.347 0.263 6.907

lake O vs T fish 4.530 1.035 19.825

lake O vs T invt 3.766 0.871 16.274

lake O vs T rept 2.813 0.542 14.602

lake O vs T bird 0.794 0.062 10.162

size big vs small fish 1.393 0.579 3.354

size big vs small invt 0.324 0.120 0.872

size big vs small rept 1.979 0.552 7.096

size big vs small bird 2.617 0.647 10.581

Obs lake size food count _LEVEL_ fitted_p

1 H small fish 23 fish 0.53530

2 H small fish 23 invt 0.09310

3 H small fish 23 rept 0.04746

4 H small fish 23 bird 0.07040

5 H small fish 23 othr 0.25374

6 H small invt 4 fish 0.53530

7 H small invt 4 invt 0.09310

8 H small invt 4 rept 0.04746

9 H small invt 4 bird 0.07040

10 H small invt 4 othr 0.25374

11 H small rept 2 fish 0.53530

12 H small rept 2 invt 0.09310

13 H small rept 2 rept 0.04746

14 H small rept 2 bird 0.07040

15 H small rept 2 othr 0.25374

16 H small bird 2 fish 0.53530

17 H small bird 2 invt 0.09310

18 H small bird 2 rept 0.04746

19 H small bird 2 bird 0.07040

20 H small bird 2 othr 0.25374

21 H small othr 8 fish 0.53530

22 H small othr 8 invt 0.09310

23 H small othr 8 rept 0.04746

24 H small othr 8 bird 0.07040

25 H small othr 8 othr 0.25374

26 H big fish 7 fish 0.57020

27 H big fish 7 invt 0.02307

28 H big fish 7 rept 0.07182

29 H big fish 7 bird 0.14090

30 H big fish 7 othr 0.19401

31 H big invt 0 fish 0.57020

32 H big invt 0 invt 0.02307

33 H big invt 0 rept 0.07182

34 H big invt 0 bird 0.14090

35 H big invt 0 othr 0.19401

36 H big rept 1 fish 0.57020

37 H big rept 1 invt 0.02307

38 H big rept 1 rept 0.07182

39 H big rept 1 bird 0.14090

40 H big rept 1 othr 0.19401

41 H big bird 3 fish 0.57020

42 H big bird 3 invt 0.02307

43 H big bird 3 rept 0.07182

44 H big bird 3 bird 0.14090

45 H big bird 3 othr 0.19401

46 H big othr 5 fish 0.57020

47 H big othr 5 invt 0.02307

48 H big othr 5 rept 0.07182

49 H big othr 5 bird 0.14090

50 H big othr 5 othr 0.19401

51 O small fish 5 fish 0.25819

3 | Page