File tree Expand file tree Collapse file tree 1 file changed +17
-2
lines changed Expand file tree Collapse file tree 1 file changed +17
-2
lines changed Original file line number Diff line number Diff line change @@ -60,10 +60,25 @@ from pymare.estimators import VarianceBasedLikelihoodEstimator
6060dataset = Dataset(y, v, X)
6161# Estimator class for likelihood-based methods when variances are known
6262estimator = 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()
6667results = estimator.summary()
6768# Print summary of results as a pandas DataFrame
6869print (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+ ```
You can’t perform that action at this time.
0 commit comments