Skip to content

Commit 2f190dd

Browse files
committed
update README
1 parent d20e835 commit 2f190dd

File tree

1 file changed

+17
-2
lines changed

1 file changed

+17
-2
lines changed

README.md

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,10 +60,25 @@ from pymare.estimators import VarianceBasedLikelihoodEstimator
6060
dataset = Dataset(y, v, X)
6161
# Estimator class for likelihood-based methods when variances are known
6262
estimator = VarianceBasedLikelihoodEstimator(method='REML')
63-
# All estimators accept a `Dataset` instance as the first argument to `.fit()`
64-
estimator.fit(dataset)
63+
# All estimators expose a fit_dataset() method that takes a `Dataset`
64+
# instance as the first (and usually only) argument.
65+
estimator.fit_dataset(dataset)
6566
# Post-fitting we can obtain a MetaRegressionResults instance via .summary()
6667
results = estimator.summary()
6768
# Print summary of results as a pandas DataFrame
6869
print(result.to_df())
6970
```
71+
72+
And if we want to be even more explicit, we can avoid the `Dataset` abstraction
73+
entirely (though we'll lose some convenient validation checks):
74+
75+
```python
76+
estimator = VarianceBasedLikelihoodEstimator(method='REML')
77+
78+
# X must be 2-d; this is one of the things the Dataset implicitly handles.
79+
X = X[:, None]
80+
81+
estimator.fit(y, v, X)
82+
83+
results = estimator.summary()
84+
```

0 commit comments

Comments
 (0)