PyMARE 0.0.4rc2__tar.gz → 0.0.5__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- PyMARE-0.0.5/LICENSE +21 -0
- {PyMARE-0.0.4rc2 → PyMARE-0.0.5}/PKG-INFO +4 -4
- {PyMARE-0.0.4rc2 → PyMARE-0.0.5}/PyMARE.egg-info/PKG-INFO +4 -4
- {PyMARE-0.0.4rc2 → PyMARE-0.0.5}/PyMARE.egg-info/SOURCES.txt +1 -0
- {PyMARE-0.0.4rc2 → PyMARE-0.0.5}/PyMARE.egg-info/requires.txt +5 -3
- PyMARE-0.0.5/pymare/__init__.py +50 -0
- {PyMARE-0.0.4rc2 → PyMARE-0.0.5}/pymare/_version.py +3 -3
- {PyMARE-0.0.4rc2 → PyMARE-0.0.5}/pymare/core.py +0 -1
- {PyMARE-0.0.4rc2 → PyMARE-0.0.5}/pymare/datasets/__init__.py +1 -0
- {PyMARE-0.0.4rc2 → PyMARE-0.0.5}/pymare/datasets/metadat.py +1 -0
- {PyMARE-0.0.4rc2 → PyMARE-0.0.5}/pymare/effectsize/__init__.py +1 -0
- {PyMARE-0.0.4rc2 → PyMARE-0.0.5}/pymare/effectsize/base.py +1 -3
- {PyMARE-0.0.4rc2 → PyMARE-0.0.5}/pymare/estimators/__init__.py +1 -0
- {PyMARE-0.0.4rc2 → PyMARE-0.0.5}/pymare/estimators/combination.py +81 -6
- {PyMARE-0.0.4rc2 → PyMARE-0.0.5}/pymare/estimators/estimators.py +20 -12
- {PyMARE-0.0.4rc2 → PyMARE-0.0.5}/pymare/results.py +1 -2
- {PyMARE-0.0.4rc2 → PyMARE-0.0.5}/pymare/stats.py +1 -1
- {PyMARE-0.0.4rc2 → PyMARE-0.0.5}/pymare/utils.py +1 -0
- {PyMARE-0.0.4rc2 → PyMARE-0.0.5}/pyproject.toml +2 -2
- {PyMARE-0.0.4rc2 → PyMARE-0.0.5}/setup.cfg +9 -6
- PyMARE-0.0.4rc2/pymare/__init__.py +0 -15
- {PyMARE-0.0.4rc2 → PyMARE-0.0.5}/MANIFEST.in +0 -0
- {PyMARE-0.0.4rc2 → PyMARE-0.0.5}/PyMARE.egg-info/dependency_links.txt +0 -0
- {PyMARE-0.0.4rc2 → PyMARE-0.0.5}/PyMARE.egg-info/not-zip-safe +0 -0
- {PyMARE-0.0.4rc2 → PyMARE-0.0.5}/PyMARE.egg-info/top_level.txt +0 -0
- {PyMARE-0.0.4rc2 → PyMARE-0.0.5}/README.md +0 -0
- {PyMARE-0.0.4rc2 → PyMARE-0.0.5}/pymare/effectsize/expressions.json +0 -0
- {PyMARE-0.0.4rc2 → PyMARE-0.0.5}/pymare/effectsize/expressions.py +1 -1
- {PyMARE-0.0.4rc2 → PyMARE-0.0.5}/pymare/resources/datasets/michael2013.json +0 -0
- {PyMARE-0.0.4rc2 → PyMARE-0.0.5}/pymare/resources/datasets/michael2013.tsv +0 -0
- {PyMARE-0.0.4rc2 → PyMARE-0.0.5}/setup.py +0 -0
- {PyMARE-0.0.4rc2 → PyMARE-0.0.5}/versioneer.py +0 -0
PyMARE-0.0.5/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2020- pymare developers
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: PyMARE
|
|
3
|
-
Version: 0.0.
|
|
3
|
+
Version: 0.0.5
|
|
4
4
|
Summary: PyMARE: Python Meta-Analysis & Regression Engine
|
|
5
5
|
Home-page: https://github.com/neurostuff/PyMARE
|
|
6
6
|
Author: PyMARE developers
|
|
@@ -28,12 +28,12 @@ Classifier: Environment :: Console
|
|
|
28
28
|
Classifier: Intended Audience :: Science/Research
|
|
29
29
|
Classifier: License :: OSI Approved :: MIT License
|
|
30
30
|
Classifier: Operating System :: OS Independent
|
|
31
|
-
Classifier: Programming Language :: Python :: 3.6
|
|
32
|
-
Classifier: Programming Language :: Python :: 3.7
|
|
33
31
|
Classifier: Programming Language :: Python :: 3.8
|
|
34
32
|
Classifier: Programming Language :: Python :: 3.9
|
|
33
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
34
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
35
35
|
Classifier: Topic :: Scientific/Engineering
|
|
36
|
-
Requires-Python: >=3.
|
|
36
|
+
Requires-Python: >=3.8
|
|
37
37
|
Description-Content-Type: text/x-rst
|
|
38
38
|
Provides-Extra: doc
|
|
39
39
|
Provides-Extra: tests
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: PyMARE
|
|
3
|
-
Version: 0.0.
|
|
3
|
+
Version: 0.0.5
|
|
4
4
|
Summary: PyMARE: Python Meta-Analysis & Regression Engine
|
|
5
5
|
Home-page: https://github.com/neurostuff/PyMARE
|
|
6
6
|
Author: PyMARE developers
|
|
@@ -28,12 +28,12 @@ Classifier: Environment :: Console
|
|
|
28
28
|
Classifier: Intended Audience :: Science/Research
|
|
29
29
|
Classifier: License :: OSI Approved :: MIT License
|
|
30
30
|
Classifier: Operating System :: OS Independent
|
|
31
|
-
Classifier: Programming Language :: Python :: 3.6
|
|
32
|
-
Classifier: Programming Language :: Python :: 3.7
|
|
33
31
|
Classifier: Programming Language :: Python :: 3.8
|
|
34
32
|
Classifier: Programming Language :: Python :: 3.9
|
|
33
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
34
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
35
35
|
Classifier: Topic :: Scientific/Engineering
|
|
36
|
-
Requires-Python: >=3.
|
|
36
|
+
Requires-Python: >=3.8
|
|
37
37
|
Description-Content-Type: text/x-rst
|
|
38
38
|
Provides-Extra: doc
|
|
39
39
|
Provides-Extra: tests
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
numpy>=1.8.0
|
|
2
2
|
pandas
|
|
3
|
-
scipy
|
|
3
|
+
scipy<1.13.0
|
|
4
4
|
sympy
|
|
5
5
|
wrapt
|
|
6
6
|
|
|
@@ -15,7 +15,7 @@ seaborn
|
|
|
15
15
|
sphinx>=3.5
|
|
16
16
|
sphinx-argparse
|
|
17
17
|
sphinx-copybutton
|
|
18
|
-
sphinx_gallery
|
|
18
|
+
sphinx_gallery
|
|
19
19
|
sphinx_rtd_theme
|
|
20
20
|
sphinxcontrib-bibtex
|
|
21
21
|
codecov
|
|
@@ -27,6 +27,8 @@ flake8-docstrings
|
|
|
27
27
|
flake8-isort
|
|
28
28
|
pytest
|
|
29
29
|
pytest-cov
|
|
30
|
+
pystan
|
|
31
|
+
arviz
|
|
30
32
|
|
|
31
33
|
[doc]
|
|
32
34
|
m2r
|
|
@@ -39,7 +41,7 @@ seaborn
|
|
|
39
41
|
sphinx>=3.5
|
|
40
42
|
sphinx-argparse
|
|
41
43
|
sphinx-copybutton
|
|
42
|
-
sphinx_gallery
|
|
44
|
+
sphinx_gallery
|
|
43
45
|
sphinx_rtd_theme
|
|
44
46
|
sphinxcontrib-bibtex
|
|
45
47
|
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
"""PyMARE: Python Meta-Analysis & Regression Engine."""
|
|
2
|
+
|
|
3
|
+
import sys
|
|
4
|
+
import warnings
|
|
5
|
+
|
|
6
|
+
from .core import Dataset, meta_regression
|
|
7
|
+
from .effectsize import OneSampleEffectSizeConverter, TwoSampleEffectSizeConverter
|
|
8
|
+
|
|
9
|
+
__all__ = [
|
|
10
|
+
"Dataset",
|
|
11
|
+
"meta_regression",
|
|
12
|
+
"OneSampleEffectSizeConverter",
|
|
13
|
+
"TwoSampleEffectSizeConverter",
|
|
14
|
+
]
|
|
15
|
+
|
|
16
|
+
from . import _version
|
|
17
|
+
|
|
18
|
+
__version__ = _version.get_versions()["version"]
|
|
19
|
+
del _version
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
def _py367_deprecation_warning():
|
|
23
|
+
"""Deprecation warnings message.
|
|
24
|
+
|
|
25
|
+
Notes
|
|
26
|
+
-----
|
|
27
|
+
Adapted from NiMARE.
|
|
28
|
+
"""
|
|
29
|
+
py36_warning = (
|
|
30
|
+
"Python 3.6 and 3.7 support is deprecated and will be removed in release 0.0.5 of PyMARE. "
|
|
31
|
+
"Consider switching to Python 3.8, 3.9."
|
|
32
|
+
)
|
|
33
|
+
warnings.filterwarnings("once", message=py36_warning)
|
|
34
|
+
warnings.warn(message=py36_warning, category=FutureWarning, stacklevel=3)
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
def _python_deprecation_warnings():
|
|
38
|
+
"""Raise deprecation warnings.
|
|
39
|
+
|
|
40
|
+
Notes
|
|
41
|
+
-----
|
|
42
|
+
Adapted from NiMARE.
|
|
43
|
+
"""
|
|
44
|
+
if sys.version_info.major == 3 and (
|
|
45
|
+
sys.version_info.minor == 6 or sys.version_info.minor == 7
|
|
46
|
+
):
|
|
47
|
+
_py367_deprecation_warning()
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
_python_deprecation_warnings()
|
|
@@ -8,11 +8,11 @@ import json
|
|
|
8
8
|
|
|
9
9
|
version_json = '''
|
|
10
10
|
{
|
|
11
|
-
"date": "
|
|
11
|
+
"date": "2024-04-30T11:09:49-0500",
|
|
12
12
|
"dirty": false,
|
|
13
13
|
"error": null,
|
|
14
|
-
"full-revisionid": "
|
|
15
|
-
"version": "0.0.
|
|
14
|
+
"full-revisionid": "46b87a55fdaf55c9e86d5dbed4c7c6d77e4ffb8f",
|
|
15
|
+
"version": "0.0.5"
|
|
16
16
|
}
|
|
17
17
|
''' # END VERSION_JSON
|
|
18
18
|
|
|
@@ -68,7 +68,7 @@ def solve_system(system, known_vars=None):
|
|
|
68
68
|
|
|
69
69
|
# solver will return a dict if there's only one non-dummy expression
|
|
70
70
|
if isinstance(solutions, dict):
|
|
71
|
-
solutions = [
|
|
71
|
+
solutions = [[solutions[s] for s in symbols]]
|
|
72
72
|
|
|
73
73
|
# Prepare the dummy list and data args in a fixed order
|
|
74
74
|
dummy_list = list(dummies)
|
|
@@ -90,7 +90,6 @@ class EffectSizeConverter(metaclass=ABCMeta):
|
|
|
90
90
|
"""Base class for effect size converters."""
|
|
91
91
|
|
|
92
92
|
def __init__(self, data=None, **kwargs):
|
|
93
|
-
|
|
94
93
|
kwargs = {k: v for k, v in kwargs.items() if v is not None}
|
|
95
94
|
|
|
96
95
|
if data is not None:
|
|
@@ -509,7 +508,6 @@ def compute_measure(
|
|
|
509
508
|
|
|
510
509
|
# Select or infer converter class
|
|
511
510
|
if comparison == "infer":
|
|
512
|
-
|
|
513
511
|
one_samp_inputs = {"m", "sd", "n", "r"}
|
|
514
512
|
two_samp_inputs = {"m1", "m2", "sd1", "sd2", "n1", "n2"}
|
|
515
513
|
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
"""Estimators for combination (p/z) tests."""
|
|
2
|
+
|
|
2
3
|
import warnings
|
|
3
4
|
from abc import abstractmethod
|
|
4
5
|
|
|
@@ -110,17 +111,91 @@ class StoufferCombinationTest(CombinationTest):
|
|
|
110
111
|
"""
|
|
111
112
|
|
|
112
113
|
# Maps Dataset attributes onto fit() args; see BaseEstimator for details.
|
|
113
|
-
_dataset_attr_map = {"z": "y", "w": "v"}
|
|
114
|
+
_dataset_attr_map = {"z": "y", "w": "n", "g": "v"}
|
|
115
|
+
|
|
116
|
+
def _inflation_term(self, z, w, g, corr=None):
|
|
117
|
+
"""Calculate the variance inflation term for each group.
|
|
118
|
+
|
|
119
|
+
This term is used to adjust the variance of the combined z-score when
|
|
120
|
+
multiple sample come from the same study.
|
|
121
|
+
|
|
122
|
+
Parameters
|
|
123
|
+
----------
|
|
124
|
+
z : :obj:`numpy.ndarray` of shape (n, d)
|
|
125
|
+
Array of z-values.
|
|
126
|
+
w : :obj:`numpy.ndarray` of shape (n, d)
|
|
127
|
+
Array of weights.
|
|
128
|
+
g : :obj:`numpy.ndarray` of shape (n, d)
|
|
129
|
+
Array of group labels.
|
|
130
|
+
corr : :obj:`numpy.ndarray` of shape (n, n), optional
|
|
131
|
+
The correlation matrix of the z-values. If None, it will be calculated.
|
|
132
|
+
|
|
133
|
+
Returns
|
|
134
|
+
-------
|
|
135
|
+
sigma : float
|
|
136
|
+
The variance inflation term.
|
|
137
|
+
"""
|
|
138
|
+
# Only center if the samples are not all the same, to prevent division by zero
|
|
139
|
+
# when calculating the correlation matrix.
|
|
140
|
+
# This centering is problematic for N=2
|
|
141
|
+
all_samples_same = np.all(np.equal(z, z[0]), axis=0).all()
|
|
142
|
+
z = z if all_samples_same else z - z.mean(0)
|
|
143
|
+
|
|
144
|
+
# Use the value from one feature, as all features have the same groups and weights
|
|
145
|
+
groups = g[:, 0]
|
|
146
|
+
weights = w[:, 0]
|
|
147
|
+
|
|
148
|
+
# Loop over groups
|
|
149
|
+
unique_groups = np.unique(groups)
|
|
150
|
+
|
|
151
|
+
sigma = 0
|
|
152
|
+
for group in unique_groups:
|
|
153
|
+
group_indices = np.where(groups == group)[0]
|
|
154
|
+
group_z = z[group_indices]
|
|
155
|
+
|
|
156
|
+
# For groups with only one sample the contribution to the summand is 0
|
|
157
|
+
n_samples = len(group_indices)
|
|
158
|
+
if n_samples < 2:
|
|
159
|
+
continue
|
|
114
160
|
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
161
|
+
# Calculate the within group correlation matrix and sum the non-diagonal elements
|
|
162
|
+
if corr is None:
|
|
163
|
+
if z.shape[1] < 2:
|
|
164
|
+
raise ValueError("The number of features must be greater than 1.")
|
|
165
|
+
group_corr = np.corrcoef(group_z, rowvar=True)
|
|
166
|
+
else:
|
|
167
|
+
group_corr = corr[group_indices][:, group_indices]
|
|
118
168
|
|
|
119
|
-
|
|
169
|
+
upper_indices = np.triu_indices(n_samples, k=1)
|
|
170
|
+
non_diag_corr = group_corr[upper_indices]
|
|
171
|
+
w_i, w_j = weights[upper_indices[0]], weights[upper_indices[1]]
|
|
172
|
+
|
|
173
|
+
sigma += (2 * w_i * w_j * non_diag_corr).sum()
|
|
174
|
+
|
|
175
|
+
return sigma
|
|
176
|
+
|
|
177
|
+
def fit(self, z, w=None, g=None, corr=None):
|
|
178
|
+
"""Fit the estimator to z-values, optionally with weights and groups."""
|
|
179
|
+
return super().fit(z, w=w, g=g, corr=corr)
|
|
180
|
+
|
|
181
|
+
def p_value(self, z, w=None, g=None, corr=None):
|
|
120
182
|
"""Calculate p-values."""
|
|
121
183
|
if w is None:
|
|
122
184
|
w = np.ones_like(z)
|
|
123
|
-
|
|
185
|
+
|
|
186
|
+
if g is None and corr is not None:
|
|
187
|
+
warnings.warn("Correlation matrix provided without groups. Ignoring.")
|
|
188
|
+
|
|
189
|
+
if g is not None and corr is not None and g.shape[0] != corr.shape[0]:
|
|
190
|
+
raise ValueError("Group labels must have the same length as the correlation matrix.")
|
|
191
|
+
|
|
192
|
+
# Calculate the variance inflation term, sum of non-diagonal elements of sigma.
|
|
193
|
+
sigma = self._inflation_term(z, w, g, corr=corr) if g is not None else 0
|
|
194
|
+
|
|
195
|
+
# The sum of diagonal elements of sigma is given by (w**2).sum(0).
|
|
196
|
+
variance = (w**2).sum(0) + sigma
|
|
197
|
+
|
|
198
|
+
cz = (z * w).sum(0) / np.sqrt(variance)
|
|
124
199
|
return ss.norm.sf(cz)
|
|
125
200
|
|
|
126
201
|
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"""Meta-regression estimator classes."""
|
|
2
2
|
|
|
3
|
+
import sys
|
|
3
4
|
from abc import ABCMeta, abstractmethod
|
|
4
5
|
from inspect import getfullargspec
|
|
5
6
|
from warnings import warn
|
|
@@ -553,8 +554,8 @@ class StanMetaRegression(BaseEstimator):
|
|
|
553
554
|
|
|
554
555
|
Warning
|
|
555
556
|
-------
|
|
556
|
-
|
|
557
|
-
|
|
557
|
+
:obj:`~pymare.estimators.StanMetaRegression` uses Pystan 3, which requires Python 3.7.
|
|
558
|
+
Pystan 3 should not be used with PyMARE and Python 3.6 or earlier.
|
|
558
559
|
"""
|
|
559
560
|
|
|
560
561
|
_result_cls = BayesianMetaRegressionResults
|
|
@@ -564,6 +565,13 @@ class StanMetaRegression(BaseEstimator):
|
|
|
564
565
|
self.model = None
|
|
565
566
|
self.result_ = None
|
|
566
567
|
|
|
568
|
+
if sys.version_info < (3, 7):
|
|
569
|
+
raise RuntimeError(
|
|
570
|
+
"StanMetaRegression uses Pystan 3, which requires python 3.7 or higher. "
|
|
571
|
+
f"You are running Python {sys.version_info.major}.{sys.version_info.minor}. "
|
|
572
|
+
"Pystan 3 should not be used with PyMARE and Python 3.6 or earlier."
|
|
573
|
+
)
|
|
574
|
+
|
|
567
575
|
def compile(self):
|
|
568
576
|
"""Compile the Stan model."""
|
|
569
577
|
# Note: we deliberately use a centered parameterization for the
|
|
@@ -575,7 +583,7 @@ class StanMetaRegression(BaseEstimator):
|
|
|
575
583
|
int<lower=1> N;
|
|
576
584
|
int<lower=1> K;
|
|
577
585
|
vector[N] y;
|
|
578
|
-
int<lower=1,upper=K> id
|
|
586
|
+
array[N] int<lower=1,upper=K> id;
|
|
579
587
|
int<lower=1> C;
|
|
580
588
|
matrix[K, C] X;
|
|
581
589
|
vector[N] sigma;
|
|
@@ -595,13 +603,11 @@ class StanMetaRegression(BaseEstimator):
|
|
|
595
603
|
}
|
|
596
604
|
"""
|
|
597
605
|
try:
|
|
598
|
-
|
|
606
|
+
import stan
|
|
599
607
|
except ImportError:
|
|
600
|
-
raise ImportError(
|
|
601
|
-
"Please install pystan or, if using Python 3.7+, switch to Python 3.6."
|
|
602
|
-
)
|
|
608
|
+
raise ImportError("Please install pystan.")
|
|
603
609
|
|
|
604
|
-
self.model =
|
|
610
|
+
self.model = stan.build(spec, data=self.data)
|
|
605
611
|
|
|
606
612
|
def fit(self, y, v, X, groups=None):
|
|
607
613
|
"""Run the Stan sampler and return results.
|
|
@@ -645,9 +651,6 @@ class StanMetaRegression(BaseEstimator):
|
|
|
645
651
|
"shape {}.".format(y.shape)
|
|
646
652
|
)
|
|
647
653
|
|
|
648
|
-
if self.model is None:
|
|
649
|
-
self.compile()
|
|
650
|
-
|
|
651
654
|
N = y.shape[0]
|
|
652
655
|
groups = groups or np.arange(1, N + 1, dtype=int)
|
|
653
656
|
K = len(np.unique(groups))
|
|
@@ -662,7 +665,12 @@ class StanMetaRegression(BaseEstimator):
|
|
|
662
665
|
"sigma": v.ravel(),
|
|
663
666
|
}
|
|
664
667
|
|
|
665
|
-
self.
|
|
668
|
+
self.data = data
|
|
669
|
+
|
|
670
|
+
if self.model is None:
|
|
671
|
+
self.compile()
|
|
672
|
+
|
|
673
|
+
self.result_ = self.model.sample(**self.sampling_kwargs)
|
|
666
674
|
return self
|
|
667
675
|
|
|
668
676
|
def summary(self, ci=95):
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
"""Tools for representing and manipulating meta-regression results."""
|
|
2
|
+
|
|
2
3
|
import itertools
|
|
3
4
|
from functools import lru_cache
|
|
4
5
|
from inspect import getfullargspec
|
|
@@ -331,7 +332,6 @@ class MetaRegressionResults:
|
|
|
331
332
|
|
|
332
333
|
# Loop over parallel datasets
|
|
333
334
|
for i in range(n_datasets):
|
|
334
|
-
|
|
335
335
|
y = self.dataset.y[:, i]
|
|
336
336
|
y_perm = np.repeat(y[:, None], n_perm, axis=1)
|
|
337
337
|
|
|
@@ -471,7 +471,6 @@ class CombinationTestResults:
|
|
|
471
471
|
|
|
472
472
|
# Loop over parallel datasets
|
|
473
473
|
for i in range(n_datasets):
|
|
474
|
-
|
|
475
474
|
y = self.dataset.y[:, i]
|
|
476
475
|
y_perm = np.repeat(y[:, None], n_perm, axis=1)
|
|
477
476
|
|
|
@@ -109,7 +109,7 @@ def q_profile(y, v, X, alpha=0.05):
|
|
|
109
109
|
ub_start = 2 * DerSimonianLaird().fit(y, v, X).params_["tau2"]
|
|
110
110
|
|
|
111
111
|
lb = minimize(lambda x: (q_gen(*args, x) - l_crit) ** 2, [0], bounds=bds).x[0]
|
|
112
|
-
ub = minimize(lambda x: (q_gen(*args, x) - u_crit) ** 2,
|
|
112
|
+
ub = minimize(lambda x: (q_gen(*args, x) - u_crit) ** 2, ub_start, bounds=bds).x[0]
|
|
113
113
|
return {"ci_l": lb, "ci_u": ub}
|
|
114
114
|
|
|
115
115
|
|
|
@@ -6,7 +6,7 @@ author_email = tsalo006@fiu.edu
|
|
|
6
6
|
maintainer = Taylor Salo
|
|
7
7
|
maintainer_email = tsalo006@fiu.edu
|
|
8
8
|
description = PyMARE: Python Meta-Analysis & Regression Engine
|
|
9
|
-
|
|
9
|
+
description_file = README.md
|
|
10
10
|
long_description =
|
|
11
11
|
PyMARE: Python Meta-Analysis & Regression Engine
|
|
12
12
|
================================================
|
|
@@ -28,18 +28,18 @@ classifiers =
|
|
|
28
28
|
Intended Audience :: Science/Research
|
|
29
29
|
License :: OSI Approved :: MIT License
|
|
30
30
|
Operating System :: OS Independent
|
|
31
|
-
Programming Language :: Python :: 3.6
|
|
32
|
-
Programming Language :: Python :: 3.7
|
|
33
31
|
Programming Language :: Python :: 3.8
|
|
34
32
|
Programming Language :: Python :: 3.9
|
|
33
|
+
Programming Language :: Python :: 3.10
|
|
34
|
+
Programming Language :: Python :: 3.11
|
|
35
35
|
Topic :: Scientific/Engineering
|
|
36
36
|
|
|
37
37
|
[options]
|
|
38
|
-
python_requires = >= 3.
|
|
38
|
+
python_requires = >= 3.8
|
|
39
39
|
install_requires =
|
|
40
40
|
numpy>=1.8.0
|
|
41
41
|
pandas
|
|
42
|
-
scipy
|
|
42
|
+
scipy<1.13.0 # https://github.com/arviz-devs/arviz/issues/2336
|
|
43
43
|
sympy
|
|
44
44
|
wrapt
|
|
45
45
|
packages = find:
|
|
@@ -57,7 +57,7 @@ doc =
|
|
|
57
57
|
sphinx>=3.5
|
|
58
58
|
sphinx-argparse
|
|
59
59
|
sphinx-copybutton
|
|
60
|
-
sphinx_gallery
|
|
60
|
+
sphinx_gallery
|
|
61
61
|
sphinx_rtd_theme
|
|
62
62
|
sphinxcontrib-bibtex
|
|
63
63
|
tests =
|
|
@@ -76,6 +76,7 @@ stan =
|
|
|
76
76
|
all =
|
|
77
77
|
%(doc)s
|
|
78
78
|
%(tests)s
|
|
79
|
+
%(stan)s
|
|
79
80
|
|
|
80
81
|
[options.package_data]
|
|
81
82
|
* =
|
|
@@ -97,6 +98,8 @@ max-line-length = 99
|
|
|
97
98
|
exclude = *build/,_version.py
|
|
98
99
|
putty-ignore =
|
|
99
100
|
*/__init__.py : +F401
|
|
101
|
+
per-file-ignores =
|
|
102
|
+
*/__init__.py:D401
|
|
100
103
|
ignore = E203,E402,E722,W503
|
|
101
104
|
docstring-convention = numpy
|
|
102
105
|
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
"""PyMARE: Python Meta-Analysis & Regression Engine."""
|
|
2
|
-
from .core import Dataset, meta_regression
|
|
3
|
-
from .effectsize import OneSampleEffectSizeConverter, TwoSampleEffectSizeConverter
|
|
4
|
-
|
|
5
|
-
__all__ = [
|
|
6
|
-
"Dataset",
|
|
7
|
-
"meta_regression",
|
|
8
|
-
"OneSampleEffectSizeConverter",
|
|
9
|
-
"TwoSampleEffectSizeConverter",
|
|
10
|
-
]
|
|
11
|
-
|
|
12
|
-
from . import _version
|
|
13
|
-
|
|
14
|
-
__version__ = _version.get_versions()["version"]
|
|
15
|
-
del _version
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
"""Statistical expressions."""
|
|
2
|
+
|
|
2
3
|
import json
|
|
3
4
|
from collections import defaultdict
|
|
4
5
|
from itertools import chain
|
|
@@ -90,7 +91,6 @@ def select_expressions(target, known_vars, type=1):
|
|
|
90
91
|
results = []
|
|
91
92
|
|
|
92
93
|
for exp in exp_dict[sym]:
|
|
93
|
-
|
|
94
94
|
candidates = []
|
|
95
95
|
|
|
96
96
|
sym_names = set(s.name for s in exp.symbols)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|