02-17-2015 10:44 AM
I'm attempting to run a binomial regression on a data set using the genmod function.
I am supposed to end up with an alpha hat (or intercept) value of .456, but I am getting a value of -.1761. However, the Pearson chi-square and scaled Pearson chi-square values (35.5) are correct.
I am able to get the correct answer in R, but I must have something wrong in SAS.
Below is my code:
input Game Success Attempts;
1 4 5
2 5 11
3 5 14
4 5 12
5 2 7
6 7 10
7 6 14
8 9 15
9 4 12
10 1 4
11 13 27
12 5 17
13 6 12
14 9 9
15 7 12
16 3 10
17 8 12
18 1 6
19 18 39
20 3 13
21 10 17
22 1 6
23 3 12
proc genmod data=x;
model Success/Attempts = /link=logit dist=binomial type1 type3;
02-17-2015 12:30 PM
You are getting the intercept on the logit link scale. The inverse link is
1/(1+exp(-(-0.1761))) = .456, the required answer.
I can get this directly by using GLIMMIX instead of GENMOD, with the ILINK option on an ESTIMATE statement.
proc glimmix data=x;
model Success/Attempts = / link=logit dist=binomial s ;
estimate 'intercept' int 1 / ilink ;
This gives you the logit link intercept (-.1761), and the inverse link (labeled mean; .456). However, the ILINK option is not valid in GENMOD. I don't use GENMOD a lot, but I am not aware of an easy way to get the inverse link with this procedure.
02-19-2015 12:12 PM
Rick's approach works when one is using the log link. But the OP is using the logit link (which is the default and canonical link for the binomial). I am surprised that GENMOD does not have an ILINK option. I use is all the time with GLIMMIX.
02-19-2015 02:08 PM
Now grasping for a straw, but would it make any sense to add a dummy variable, add the NOINT option, and use the LSMESTIMATE statement, which supports the ILINK option???
dummy = 1;
proc genmod data=y;
model Success/Attempts = dummy / NOINT link=logit dist=binomial type1 type3;
lsmestimate dummy "Intercept" 1 / ilink;
02-19-2015 05:00 PM
Another general approach is to put the GENMOD results in an item store, and then use PROC PLM for post-model-fit processing. The ESTIMATE statement in PLM allows for an ILINK option. This way you don't need to use a dummy variable for the intercept.
proc genmod data=x;
model Success/Attempts = / link=logit dist=binomial type1 type3;
proc plm restore=results;
estimate 'intercept' int 1 / ilink;
02-22-2015 09:22 AM
As I see it, Rick's approach by adding the line
estimate 'Intercept' int 1 / EXP ;
in proc genmod is the easiest way to get the estimate on the probability scale. It works both with log-link and log-link. Only difference is that the confidence interval is slightly difference. The other suggested solutions also works, but I see no reason to make it more complicated.
02-22-2015 10:11 AM
Jacob, You can only use the EXP option with the log link, not with the logit link. If your probability is low (say, <0.10 or so), then the logit is approximately the same as the log. Thus, the EXP option may appear to work for both link functions. But you could get seriously wrong answers in general if you used this with the logit link.
ADDITION (EDIT): Let me slightly correct myself. The EXP option does give the inverse link for a log, not for a logit. Thus, as I wrote above, the output line for the EXP option would be misleading (wrong) if you used the logit link. However, I just realized that you get the correct inverse link if you just used:
estimate 'intercept' int 1 ;
That is, you get a second line of results with the correct inverse link just by using an estimate statement (without the EXP option). It happens automatically in GENMOD (unlike in GLIMMIX), so that is why there is no ILINK option. If you also add the EXP option, you get an additional line of (possibly) meaningless results if you are not using a log link.
02-22-2015 10:26 AM
I agree that the EXP-option will not work with the logit-link. That was not what I meant. The estimate-statement automatically produce the correct estimate on probability scale.
Below is the output when the log-link is used. The "Mean Estimate" gives the probability estimate, and also confidence intervals are produced (in bold). Almost same output if logit is used as link.
estimate 'intercept' intercept 1;
|Label||Estimate||Confidence Limits||Estimate||Error||Alpha||Confidence Limits||Square||Pr > ChiSq|
02-22-2015 10:30 AM
Our posts crossed in the ether. I just updated my earlier post (check it out) with the same information. As I wrote, and you correctly discovered, you automatically get the correct inverse link just by using an estimate statement (without an EXP option).