-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Confidence intervals from farrington.manning #23
Comments
Hey, thanks for reporting this. I think I know why this happens, but I am not sure if SAS does it the better way. In the Farrington-Manning test, the variance for the test statistic is calculated from the maximum likelihood estimates of p_1 and p_2 under the restriction p_1^tilde - p_2^tilde = s_0 (see the original paper). Changing delta (which in their notation is s_0) changes the variance estimate. Since a confidence interval should give the values of the null hypothesis space for which the test does not reject the null hypothesis, I think it makes sense to use these values for calculating the variance estimate to be used in the test statistic. For your example, that means that for the interval [-0.16278681, 0.03590955], the respective variance estimates were calculated under the respective assumptions s_0 = -0.16278681 and s_0 = 0.03590955. As you noted, this means that whatever you supply for delta is irrelevant for the calculation of the confidence interval. What I think SAS does is calculate only a single variance estimate under the assumption s_0 = whatever you supplied, and then construct a confidence interval as z + upper_limit / variance = 97.5% normal quantile, z - lower_limit / variance = 2.5% normal quantile. I amended the code to what I think SAS does, and for the test cases I tried it seems to match up pretty well. Here is what i think SAS does (changes to the original version are commented):
Here are the R test cases:
Here are the SAS test cases:
Hope that helps. Since I'm not yet convinced that the SAS-way is actually better, I'm gonna leave it as it is for now. |
I'm running DescrTab2 (2.1.16), using the 'farrington.manning' function. I get the same confidence intervals for different deltas, which is not what I expect.
and I get the same values if I change delta, e.g. to 0.05, 0.1, 0.2.
E.g. SAS will give slightly different confidence intervals depending on the delta parameter - and this seems to be appropriate considering the test. Perhaps this is intended, I just wanted to bring this to your attention.
The text was updated successfully, but these errors were encountered: