Skip to content

Commit

Permalink
Fix doc welch_anova
Browse files Browse the repository at this point in the history
  • Loading branch information
raphaelvallat committed Oct 26, 2023
1 parent c66e225 commit 0af0e17
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions pingouin/parametric.py
Original file line number Diff line number Diff line change
Expand Up @@ -1234,9 +1234,8 @@ def welch_anova(data=None, dv=None, between=None):
ANOVA summary:
* ``'Source'``: Factor names
* ``'SS'``: Sums of squares
* ``'DF'``: Degrees of freedom
* ``'MS'``: Mean squares
* ``'ddof1'``: Numerator degrees of freedom
* ``'ddof2'``: Denominator degrees of freedom
* ``'F'``: F-values
* ``'p-unc'``: uncorrected p-values
* ``'np2'``: Partial eta-squared
Expand Down Expand Up @@ -1354,16 +1353,17 @@ def welch_anova(data=None, dv=None, between=None):
lamb = (3 * np.sum((1 / (grp.count() - 1)) * (1 - (weights / weights.sum())) ** 2)) / (
r**2 - 1
)
ddof2 = 1 / lamb
fval = ms_betadj / (1 + (2 * lamb * (r - 2)) / 3)
pval = f.sf(fval, ddof1, 1 / lamb)
pval = f.sf(fval, ddof1, ddof2)
np2 = ss_bet / (ss_bet + ss_res)

# Create output dataframe
aov = pd.DataFrame(
{
"Source": between,
"ddof1": ddof1,
"ddof2": 1 / lamb,
"ddof2": ddof2,
"F": fval,
"p-unc": pval,
"np2": np2,
Expand Down

0 comments on commit 0af0e17

Please sign in to comment.