You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
a suggested code or documentation change, improvement to the code, or feature request
It seems that there is an issue with calculation of confidence intervals in mm_diffs. Instead of returning a 1 - alpha confidence interval, a 1 - 2*alpha confidence interval is currently returned.
In lines 71-72 of mm_diffs(), the confidence intervals are calculated so:
But the function documentation specifies that alpha is a "A numeric value indicating the significance level at which to calculate confidence intervals for the MMs (by default 0.95, meaning 95-percent CIs are returned)." The default of alpha = 0.05 gives a 90-percent confidence interval as of right now. I'm sure the solution is obvious to you; changing alpha to alpha/2 in both cases above would fix the issue. Or adding + (alpha/2) within qnorm(), which seems to be what is done in mm() and amce_diffs()
This is mainly a problem for subsequent plotting, I think.
Thank you for this package, it's awesome!
Put your code here:
## load package
library("cregg")
data("immigration")
alpha<-.05# Differences in MMs by Gender featuretemp<- mm_diffs(immigration,
ChosenImmigrant~LanguageSkills+Education,
~Gender, id=~CaseID,
alpha=alpha)
#confidence interval from mm_diffs()temp[, c("lower", "upper")]
#95% confidence interval calculated "by hand"data.frame(lower=temp$estimate- qnorm(1-alpha/2) *temp$std.error,
upper=temp$estimate+ qnorm(1-alpha/2) *temp$std.error)
## session info for your system
sessionInfo()
The text was updated successfully, but these errors were encountered:
Please specify whether your issue is about:
It seems that there is an issue with calculation of confidence intervals in mm_diffs. Instead of returning a 1 - alpha confidence interval, a 1 - 2*alpha confidence interval is currently returned.
In lines 71-72 of mm_diffs(), the confidence intervals are calculated so:
But the function documentation specifies that alpha is a "A numeric value indicating the significance level at which to calculate confidence intervals for the MMs (by default 0.95, meaning 95-percent CIs are returned)." The default of alpha = 0.05 gives a 90-percent confidence interval as of right now. I'm sure the solution is obvious to you; changing alpha to alpha/2 in both cases above would fix the issue. Or adding + (alpha/2) within qnorm(), which seems to be what is done in mm() and amce_diffs()
This is mainly a problem for subsequent plotting, I think.
Thank you for this package, it's awesome!
Put your code here:
The text was updated successfully, but these errors were encountered: