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
In the case of one-sample test, the function proportions_ztest(count, nobs, value=None, alternative='two-sided', prop_var=False) from statsmodels.stats.proportion calculates the variance based on the sample proportion, unless prop_var is specified, like so:
However, explicitly specifying prop_var is redundant, since in my opinion it should be picked up by the parameter value. I personally do not see a reason why the variance should be calculated by default using the sample proportion instead of the null hypothesis value.
I am keen to hear your opinion on this.
The text was updated successfully, but these errors were encountered:
Both versions are legitimate, it is the difference between wald tests (parameters estimated from the sample without null hypothesis restrictions) and score/LM test (parameters estimated under the null hypothesis restrictions). I followed the documentation of SAS or SPSS or some other package in this. (I don't remember which ones I looked at.)
see also the related number of possibilities to compute confidence intervals for a proportion.
The problem is that the score test has better small sample behavior than the wald test. However, at the time I mainly translated formulas to code and hadn't read yet much about the small sample behavior of those hypothesis test and related statistics.
In the case of one-sample test, the function
proportions_ztest(count, nobs, value=None, alternative='two-sided', prop_var=False)
fromstatsmodels.stats.proportion
calculates the variance based on the sample proportion, unlessprop_var
is specified, like so:However, explicitly specifying
prop_var
is redundant, since in my opinion it should be picked up by the parametervalue
. I personally do not see a reason why the variance should be calculated by default using the sample proportion instead of the null hypothesis value.I am keen to hear your opinion on this.
The text was updated successfully, but these errors were encountered: