ACCLAB / DABEST-python

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

Shared control paired ? #68

Closed chalex-eth closed 1 year ago

chalex-eth commented 5 years ago

Dear Dabest team,

Thank you for providing a such tool making easy estimation statistic.

When trying to make a shared control with a paired design with : dabest.load(Data,idx=('Baseline','Post','Off'),paired = True ,id_col = 'ID') Data consisting in a 8x3 array. I got the following error ValueError:is_pairedis True, but some idx in ('Baseline', 'Post', 'Off') does not consist only of two groups.

How to fix this in order to make a shared control with a paired design.

Maybe it can't support a paired design for shared control ? Maybe one day ?

Thank you

Kind regards,

Alex

josesho commented 5 years ago

Hi,

Do you have a dummy dataset to demonstrate the type of data you have?

Joses

chalex-eth commented 5 years ago

Hi,

Here a bunch of code to reproduce my data shape

from scipy.stats import norm 
import pandas as pd
Ns = 8 

c1 = norm.rvs(loc=3, scale=0.4, size=Ns)
c2 = norm.rvs(loc=3.5, scale=0.75, size=Ns)
c3 = norm.rvs(loc=3.25, scale=0.4, size=Ns)
id_col = pd.Series(range(1, Ns+1))

df = pd.DataFrame({'Control' : c1,   'Delay1' : c2,  'Delay2' : c3,'ID':id_col})
dab = dabest.load(df,idx=('Control','Delay1','Delay2'),paired = True ,id_col = 'ID')

And the error

ValueError:is_pairedis True, but some idx in ('Control', 'Delay1', 'Delay2') does not consist only of two groups.

josesho commented 5 years ago

I think the plot you want is the successive repeated measures plot, which would include a parallel coordinates plot, and the bootstrap effect sizes below.

parallel coordinates plot

A mock up of the plot (which is currently unavailble) would be this:

repeated-successive-mockup

There are plans to include this into the repertoire of estimation graphics; happy to accept your PR if you implement it!

ZHANGROU-99 commented 1 year ago

Hi,

Thanks for your report!

We're glad to inform you that we have fixed this issue in the new version 2023.2.14, which has already been released. Please update to the latest version and check out the "Tutorial:Repeated Measures" part of our tutorial.

We're going to close this issue now, but please feel free to reopen it or create a new one if you encounter any further problems.