ACCLAB / DABEST-python

Data Analysis with Bootstrapped ESTimation
https://acclab.github.io/DABEST-python/
Apache License 2.0
341 stars 47 forks source link

Plots for Shared Control Groups with Different Number of Units #79

Closed XiangWanggithub closed 5 years ago

XiangWanggithub commented 5 years ago

Dear DABEST team,

Thank you for providing this beautiful way to show estimation statistics!

When I tried to plot the shared control groups with different numbers of units, it only showed the mean and the std for the group that has the most number of units. But it worked fine when I uploaded my csv and analyzed online on the estimationstats.com. Do you have any idea why this is happening? Thank you so much!

Best, Ethan

josesho commented 5 years ago

Can you provide us a minimally reproducible code sample demonstrating the unexpected behavior?

Could you also check what version your DABEST is with

import dabest
print(dabest.__version__)

Thanks.

XiangWanggithub commented 5 years ago

Hi Josesho,

Here is a simple demonstration:

import numpy as np
import pandas as pd
import dabest
print("We're using DABEST v{}".format(dabest.__version__))`
We're using DABEST v0.2.6
from scipy.stats import norm

np.random.seed(9999)

c1DF = pd.DataFrame({'Control':norm.rvs(loc=3, scale=0.4, size=20)})
t1DF = pd.DataFrame({'Test 1': norm.rvs(loc=3.5, scale=0.5, size=30)})
t2DF = pd.DataFrame({'Test 2': norm.rvs(loc=2.5, scale=0.6, size=15)})
t3DF = pd.DataFrame({'Test 3': norm.rvs(loc=3, scale=0.75, size=30)})
t4DF = pd.DataFrame({'Test 4': norm.rvs(loc=3.5, scale=0.75, size=20)})
t5DF = pd.DataFrame({'Test 5': norm.rvs(loc=3.25, scale=0.4, size=20)})
t6DF = pd.DataFrame({'Test 6': norm.rvs(loc=3.25, scale=0.4, size=15)})

df = pd.concat([c1DF,t1DF,t2DF,t3DF,t4DF,t5DF,t6DF],axis=1)

shared_control = dabest.load(df, idx=("Control", "Test 1",
                                      "Test 2", "Test 3",
                                      "Test 4", "Test 5", "Test 6")
                            )

shared_control.mean_diff.plot();

image

josesho commented 5 years ago

Hi @XiangWanggithub

This will be patched in v0.2.7, which should be released early next week. Will ping back here when that's done.

Joses

XiangWanggithub commented 5 years ago

Great! Thank you so much!

adamcc commented 5 years ago

B CI sAa

On Sat, 19 Oct 2019 at 02:10, XEthan notifications@github.com wrote:

Great! Thank you so much!

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/ACCLAB/DABEST-python/issues/79?email_source=notifications&email_token=AADZSDOFWN6V5NO2R3DWEELQPH3YRA5CNFSM4I76YPGKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEBVMBAA#issuecomment-543867008, or unsubscribe https://github.com/notifications/unsubscribe-auth/AADZSDM5O6OCPPGD74TBWELQPH3YRANCNFSM4I76YPGA .

josesho commented 5 years ago

Fixed with #80. Please use pip install --upgrade dabest to install v0.2.7.