Disclaimer: I am really an R user but helping a client with their SAS code. I understand the basics of SAS but have trouble with customizing output to give me exactly the tests I want, hence this question! I have a model I fit with proc gee that estimates the probability of insects being attracted to various types of plant tissue as a function of time. At any given time, an insect may choose between one of four tissue types or not respond at all. There were 4 trials, 10 replicates within each trial, and each replicate consisted of 20 insects. Within each replicate, at 4 time points, the number of insects on each of the tissue types was counted. So we have repeated measures data with a non-ordered multinomial outcome. I chose to use proc gee to fit this model. Following is the code, with a small subset of the data, enough to provide a reproducible example. Each row in the data is an individual insect at a single time point (interval), with the character column "response" having five possible values: Leaftip, Male, Female, Berries, and No response. I was able to get the contrasts between different levels of "interval" (the time point) using the lsmeans statement, but I do not know how to get contrasts and the appropriate statistical test, to compare (1) the relative preference (relative risk) between the response categories within each interval and (2) the relative preference between the response categories, averaged across all four intervals. The hypothesis of interest to test would be, for example, "do insects have a higher preference for leaf tips relative to berries at time interval 1?" I found this note on calculating relative risks in a multinomial response model which seems to be doing something similar but I am not sure how to adapt the macro to work for this particular case. The examples given are for different procedures, not proc gee. Any help would be greatly appreciated! data example;
input trial rep interval response $12.;
datalines;
1 1 1 Leaftip
1 1 1 Leaftip
1 1 1 Leaftip
1 1 1 Leaftip
1 1 1 Male
1 1 1 Male
1 1 1 No response
1 1 1 No response
1 1 1 No response
1 1 1 No response
1 1 1 No response
1 1 1 No response
1 1 1 No response
1 1 1 No response
1 1 1 No response
1 1 1 No response
1 1 1 No response
1 1 1 No response
1 1 1 No response
1 1 1 No response
1 1 2 Leaftip
1 1 2 Leaftip
1 1 2 Leaftip
1 1 2 Leaftip
1 1 2 Leaftip
1 1 2 Leaftip
1 1 2 Leaftip
1 1 2 Leaftip
1 1 2 Leaftip
1 1 2 Male
1 1 2 Male
1 1 2 No response
1 1 2 No response
1 1 2 No response
1 1 2 No response
1 1 2 No response
1 1 2 No response
1 1 2 No response
1 1 2 No response
1 1 2 No response
1 1 3 Leaftip
1 1 3 Leaftip
1 1 3 Leaftip
1 1 3 Leaftip
1 1 3 Leaftip
1 1 3 Leaftip
1 1 3 Leaftip
1 1 3 Leaftip
1 1 3 Leaftip
1 1 3 Leaftip
1 1 3 Male
1 1 3 Male
1 1 3 Berries
1 1 3 No response
1 1 3 No response
1 1 3 No response
1 1 3 No response
1 1 3 No response
1 1 3 No response
1 1 3 No response
1 1 4 Leaftip
1 1 4 Leaftip
1 1 4 Leaftip
1 1 4 Leaftip
1 1 4 Leaftip
1 1 4 Leaftip
1 1 4 Leaftip
1 1 4 Leaftip
1 1 4 Leaftip
1 1 4 Leaftip
1 1 4 Leaftip
1 1 4 Leaftip
1 1 4 Leaftip
1 1 4 Leaftip
1 1 4 Leaftip
1 1 4 Leaftip
1 1 4 No response
1 1 4 No response
1 1 4 No response
1 1 4 No response
1 2 1 Leaftip
1 2 1 Leaftip
1 2 1 Leaftip
1 2 1 Leaftip
1 2 1 Male
1 2 1 Female
1 2 1 No response
1 2 1 No response
1 2 1 No response
1 2 1 No response
1 2 1 No response
1 2 1 No response
1 2 1 No response
1 2 1 No response
1 2 1 No response
1 2 1 No response
1 2 1 No response
1 2 1 No response
1 2 1 No response
1 2 1 No response
1 2 2 Leaftip
1 2 2 Leaftip
1 2 2 Leaftip
1 2 2 Leaftip
1 2 2 Leaftip
1 2 2 Leaftip
1 2 2 Berries
1 2 2 No response
1 2 2 No response
1 2 2 No response
1 2 2 No response
1 2 2 No response
1 2 2 No response
1 2 2 No response
1 2 2 No response
1 2 2 No response
1 2 2 No response
1 2 2 No response
1 2 2 No response
1 2 2 No response
1 2 3 Leaftip
1 2 3 Leaftip
1 2 3 Leaftip
1 2 3 Leaftip
1 2 3 Leaftip
1 2 3 Male
1 2 3 Berries
1 2 3 No response
1 2 3 No response
1 2 3 No response
1 2 3 No response
1 2 3 No response
1 2 3 No response
1 2 3 No response
1 2 3 No response
1 2 3 No response
1 2 3 No response
1 2 3 No response
1 2 3 No response
1 2 3 No response
1 2 4 Leaftip
1 2 4 Leaftip
1 2 4 Leaftip
1 2 4 Leaftip
1 2 4 Leaftip
1 2 4 Leaftip
1 2 4 Leaftip
1 2 4 Male
1 2 4 Male
1 2 4 No response
1 2 4 No response
1 2 4 No response
1 2 4 No response
1 2 4 No response
1 2 4 No response
1 2 4 No response
1 2 4 No response
1 2 4 No response
1 2 4 No response
1 2 4 No response
2 1 1 Leaftip
2 1 1 Leaftip
2 1 1 Leaftip
2 1 1 Berries
2 1 1 Berries
2 1 1 Berries
2 1 1 Berries
2 1 1 No response
2 1 1 No response
2 1 1 No response
2 1 1 No response
2 1 1 No response
2 1 1 No response
2 1 1 No response
2 1 1 No response
2 1 1 No response
2 1 1 No response
2 1 1 No response
2 1 1 No response
2 1 1 No response
2 1 2 Leaftip
2 1 2 Leaftip
2 1 2 Leaftip
2 1 2 Leaftip
2 1 2 Leaftip
2 1 2 Leaftip
2 1 2 Leaftip
2 1 2 Berries
2 1 2 Berries
2 1 2 Berries
2 1 2 Berries
2 1 2 No response
2 1 2 No response
2 1 2 No response
2 1 2 No response
2 1 2 No response
2 1 2 No response
2 1 2 No response
2 1 2 No response
2 1 2 No response
2 1 3 Leaftip
2 1 3 Leaftip
2 1 3 Leaftip
2 1 3 Leaftip
2 1 3 Leaftip
2 1 3 Leaftip
2 1 3 Leaftip
2 1 3 Berries
2 1 3 Berries
2 1 3 No response
2 1 3 No response
2 1 3 No response
2 1 3 No response
2 1 3 No response
2 1 3 No response
2 1 3 No response
2 1 3 No response
2 1 3 No response
2 1 3 No response
2 1 3 No response
2 1 4 Leaftip
2 1 4 Leaftip
2 1 4 Leaftip
2 1 4 Leaftip
2 1 4 Leaftip
2 1 4 Leaftip
2 1 4 Leaftip
2 1 4 Male
2 1 4 Female
2 1 4 Female
2 1 4 Berries
2 1 4 Berries
2 1 4 Berries
2 1 4 No response
2 1 4 No response
2 1 4 No response
2 1 4 No response
2 1 4 No response
2 1 4 No response
2 1 4 No response
2 2 1 Leaftip
2 2 1 No response
2 2 1 No response
2 2 1 No response
2 2 1 No response
2 2 1 No response
2 2 1 No response
2 2 1 No response
2 2 1 No response
2 2 1 No response
2 2 1 No response
2 2 1 No response
2 2 1 No response
2 2 1 No response
2 2 1 No response
2 2 1 No response
2 2 1 No response
2 2 1 No response
2 2 1 No response
2 2 1 No response
2 2 2 Leaftip
2 2 2 Leaftip
2 2 2 Leaftip
2 2 2 Leaftip
2 2 2 Male
2 2 2 Female
2 2 2 Female
2 2 2 Female
2 2 2 Female
2 2 2 Female
2 2 2 Berries
2 2 2 No response
2 2 2 No response
2 2 2 No response
2 2 2 No response
2 2 2 No response
2 2 2 No response
2 2 2 No response
2 2 2 No response
2 2 2 No response
2 2 3 Leaftip
2 2 3 Leaftip
2 2 3 Male
2 2 3 Female
2 2 3 Female
2 2 3 Female
2 2 3 Female
2 2 3 Female
2 2 3 No response
2 2 3 No response
2 2 3 No response
2 2 3 No response
2 2 3 No response
2 2 3 No response
2 2 3 No response
2 2 3 No response
2 2 3 No response
2 2 3 No response
2 2 3 No response
2 2 3 No response
2 2 4 Leaftip
2 2 4 Leaftip
2 2 4 Leaftip
2 2 4 Leaftip
2 2 4 Leaftip
2 2 4 Leaftip
2 2 4 Leaftip
2 2 4 Male
2 2 4 Male
2 2 4 Female
2 2 4 Berries
2 2 4 Berries
2 2 4 Berries
2 2 4 No response
2 2 4 No response
2 2 4 No response
2 2 4 No response
2 2 4 No response
2 2 4 No response
2 2 4 No response
;
run;
proc gee data=example;
class response trial rep interval;
model response=interval / dist=multinomial link=glogit;
repeated subject=rep(trial);
lsmeans interval / diff ilink oddsratio;
run;
... View more