Skip to content

wrong ttest result #462

@SterArcher

Description

@SterArcher

Hi!

I wanted to compare two groups using ttest function.

The violin plot shows significant overlap, but the ttest from your package returns significant result.

Image

pg.ttest(df["Skupina"], df["masa"])

           T  dof alternative     p-val         CI95%  cohen-d    BF10  \

T-test 3.828714 56 two-sided 0.000327 [0.16, 0.51] 1.00547 79.764

       power  

T-test 0.964251

When using scipy i get non-significant result.

# Perform t-test
group1 = df[df["Skupina"] == 1]["masa"]
group2 = df[df["Skupina"] == 2]["masa"]
t_stat, p_value = ttest_ind(group1, group2)

print(f"T-statistic: {t_stat}, P-value: {p_value}")

T-statistic: -1.2849905790443539, P-value: 0.20971011250741314

Why would that be? The latter result was also confirmed by another person in R.

Thank you!

Metadata

Metadata

Assignees

No one assigned

    Labels

    question 🙋Further information is requested

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions