Skip to content

Commit cfcbb8c

Browse files
authored
Revert "Delta delta"
1 parent 5617af8 commit cfcbb8c

44 files changed

Lines changed: 180 additions & 2346 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitignore

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,3 @@ fontList-v300.json
122122
# tex folders
123123
tex.cache/
124124
.Rproj.user
125-
testtt.py
126-
real.py
127-
0to2_beforeduringafter.csv
128-

dabest/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,4 @@
2323
from ._stats_tools import effsize as effsize
2424
from ._classes import TwoGroupsEffectSize, PermutationTest
2525

26-
__version__ = "0.3.9999"
26+
__version__ = "0.3.1"

dabest/_api.py

Lines changed: 5 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,8 @@
44
# Email : joseshowh@gmail.com
55

66

7-
def load(data, idx=None, x=None, y=None, paired=None, id_col=None,
8-
ci=95, resamples=5000, random_seed=12345, proportional=False,
9-
delta2 = False, experiment = None, experiment_label = None,
10-
x1_level = None):
7+
def load(data, idx, x=None, y=None, paired=False, id_col=None,
8+
ci=95, resamples=5000, random_seed=12345):
119
'''
1210
Loads data in preparation for estimation statistics.
1311
@@ -20,14 +18,10 @@ def load(data, idx=None, x=None, y=None, paired=None, id_col=None,
2018
List of column names (if 'x' is not supplied) or of category names
2119
(if 'x' is supplied). This can be expressed as a tuple of tuples,
2220
with each individual tuple producing its own contrast plot
23-
x : string or list, default None
24-
Column name(s) of the independent variable. This can be expressed as
25-
a list of 2 elements if and only if 'delta2' is True; otherwise it
26-
can only be a string.
21+
x : string, default None
2722
y : string, default None
2823
Column names for data to be plotted on the x-axis and y-axis.
29-
paired : string, default None
30-
The type of the experiment under which the data are obtained
24+
paired : boolean, default False.
3125
id_col : default None.
3226
Required if `paired` is True.
3327
ci : integer, default 95
@@ -40,21 +34,6 @@ def load(data, idx=None, x=None, y=None, paired=None, id_col=None,
4034
This integer is used to seed the random number generator during
4135
bootstrap resampling, ensuring that the confidence intervals
4236
reported are replicable.
43-
proportional : boolean, default False.
44-
TO INCLUDE MORE DESCRIPTION ABOUT DATA FORMAT
45-
delta2 : boolean, default False
46-
Indicator of delta-delta experiment
47-
experiment : String, default None
48-
The name of the column of the dataframe which contains the label of
49-
experiments
50-
experiment_lab : list, default None
51-
A list of String to specify the order of subplots for delta-delta plots.
52-
This can be expressed as a list of 2 elements if and only if 'delta2'
53-
is True; otherwise it can only be a string.
54-
x1_level : list, default None
55-
A list of String to specify the order of subplots for delta-delta plots.
56-
This can be expressed as a list of 2 elements if and only if 'delta2'
57-
is True; otherwise it can only be a string.
5837
5938
Returns
6039
-------
@@ -83,4 +62,4 @@ def load(data, idx=None, x=None, y=None, paired=None, id_col=None,
8362
'''
8463
from ._classes import Dabest
8564

86-
return Dabest(data, idx, x, y, paired, id_col, ci, resamples, random_seed, proportional, delta2, experiment, experiment_label, x1_level)
65+
return Dabest(data, idx, x, y, paired, id_col, ci, resamples, random_seed)

dabest/_bootstrap_tools.py

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,70 +9,92 @@
99

1010
class bootstrap:
1111
'''Computes the summary statistic and a bootstrapped confidence interval.
12+
1213
Keywords:
1314
x1, x2: array-like
1415
The data in a one-dimensional array form. Only x1 is required.
1516
If x2 is given, the bootstrapped summary difference between
1617
the two groups (x2-x1) is computed.
1718
NaNs are automatically discarded.
19+
1820
paired: boolean, default False
1921
Whether or not x1 and x2 are paired samples.
22+
2023
statfunction: callable, default np.mean
2124
The summary statistic called on data.
25+
2226
smoothboot: boolean, default False
2327
Taken from seaborn.algorithms.bootstrap.
2428
If True, performs a smoothed bootstrap (draws samples from a kernel
2529
destiny estimate).
30+
2631
alpha: float, default 0.05
2732
Denotes the likelihood that the confidence interval produced
2833
does not include the true summary statistic. When alpha = 0.05,
2934
a 95% confidence interval is produced.
35+
3036
reps: int, default 5000
3137
Number of bootstrap iterations to perform.
38+
3239
Returns:
3340
An `bootstrap` object reporting the summary statistics, percentile CIs,
3441
bias-corrected and accelerated (BCa) CIs, and the settings used.
42+
3543
summary: float
3644
The summary statistic.
45+
3746
is_difference: boolean
3847
Whether or not the summary is the difference between two groups.
3948
If False, only x1 was supplied.
49+
4050
is_paired: boolean
4151
Whether or not the difference reported is between 2 paired groups.
52+
4253
statistic: callable
4354
The function used to compute the summary.
55+
4456
reps: int
4557
The number of bootstrap iterations performed.
58+
4659
stat_array: array.
4760
A sorted array of values obtained by bootstrapping the input arrays.
61+
4862
ci: float
4963
The size of the confidence interval reported (in percentage).
64+
5065
pct_ci_low, pct_ci_high: floats
5166
The upper and lower bounds of the confidence interval as computed
5267
by taking the percentage bounds.
68+
5369
pct_low_high_indices: array
5470
An array with the indices in `stat_array` corresponding to the
5571
percentage confidence interval bounds.
72+
5673
bca_ci_low, bca_ci_high: floats
5774
The upper and lower bounds of the bias-corrected and accelerated
5875
(BCa) confidence interval. See Efron 1977.
76+
5977
bca_low_high_indices: array
6078
An array with the indices in `stat_array` corresponding to the BCa
6179
confidence interval bounds.
80+
6281
pvalue_1samp_ttest: float
6382
P-value obtained from scipy.stats.ttest_1samp. If 2 arrays were
6483
passed (x1 and x2), returns 'NIL'.
6584
See https://docs.scipy.org/doc/scipy-1.0.0/reference/generated/scipy.stats.ttest_1samp.html
85+
6686
pvalue_2samp_ind_ttest: float
6787
P-value obtained from scipy.stats.ttest_ind.
6888
If a single array was given (x1 only), or if `paired` is True,
6989
returns 'NIL'.
7090
See https://docs.scipy.org/doc/scipy-1.0.0/reference/generated/scipy.stats.ttest_ind.html
91+
7192
pvalue_2samp_related_ttest: float
7293
P-value obtained from scipy.stats.ttest_rel.
7394
If a single array was given (x1 only), or if `paired` is False,
7495
returns 'NIL'.
7596
See https://docs.scipy.org/doc/scipy-1.0.0/reference/generated/scipy.stats.ttest_rel.html
97+
7698
pvalue_wilcoxon: float
7799
P-value obtained from scipy.stats.wilcoxon.
78100
If a single array was given (x1 only), or if `paired` is False,
@@ -81,12 +103,14 @@ class bootstrap:
81103
the null hypothesis that the related samples x1 and x2 are from
82104
the same distribution.
83105
See https://docs.scipy.org/doc/scipy-1.0.0/reference/scipy.stats.wilcoxon.html
106+
84107
pvalue_mann_whitney: float
85108
Two-sided p-value obtained from scipy.stats.mannwhitneyu.
86109
If a single array was given (x1 only), returns 'NIL'.
87110
The Mann-Whitney U-test is a nonparametric unpaired test of the null
88111
hypothesis that x1 and x2 are from the same distribution.
89112
See https://docs.scipy.org/doc/scipy-1.0.0/reference/generated/scipy.stats.mannwhitneyu.html
113+
90114
'''
91115
def __init__(self, x1, x2=None,
92116
paired=False,
@@ -260,6 +284,7 @@ def jackknife_indexes(data):
260284
From the scikits.bootstrap package.
261285
Given an array, returns a list of arrays where each array is a set of
262286
jackknife indexes.
287+
263288
For a given set of data Y, the jackknife sample J[i] is defined as the
264289
data set Y with the ith data point deleted.
265290
"""
@@ -307,4 +332,4 @@ def bca(data, alphas, statarray, statfunction, ostat, reps):
307332
nvals = np.round((reps-1)*avals)
308333
nvals = np.nan_to_num(nvals).astype('int')
309334

310-
return nvals
335+
return nvals

0 commit comments

Comments
 (0)