PyMARE icon indicating copy to clipboard operation
PyMARE copied to clipboard

Beef up the results objects

Open tyarkoni opened this issue 5 years ago • 2 comments

The current MetaRegressionResults object is pretty barebones and intended only as a prototype. Minimally, we should:

  • [ ] Implement the skeleton summary() and plot() methods.
  • [ ] Add a __repr__ method (possibly just aliased to summary()) that includes information about the dataset and estimation (the current to_df() method provides only estimate details).
  • [x] Consider better representations of the internal parameters and associated stats, which are currently all stored in a dict.

tyarkoni avatar Dec 18 '19 21:12 tyarkoni

Here's an example meta-regression summary from metafor:

Random-Effects Model (k = 13; tau^2 estimator: EB)
 
tau^2 (estimated amount of total heterogeneity): 0.2682 (SE = 0.1801)
tau (square root of estimated tau^2 value):      0.5178
I^2 (total heterogeneity / total variability):   87.49%
H^2 (total variability / sampling variability):  7.99
 
Test for Heterogeneity:
Q(df = 12) = 85.8625, p-val < .0001
 
Model Results:
 
estimate      se     zval    pval    ci.lb    ci.ub 
 -0.5429  0.1842  -2.9474  0.0032  -0.9040  -0.1819  ** 
 
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

I'm not sure what kinds of plots we might want to implement though.

tsalo avatar Jun 03 '22 15:06 tsalo

Here's the result of a first pass at the summary:

Random-Effects Model (k = 12; tau^2 estimator: DerSimonianLaird)

tau^2 (estimated amount of total heterogeneity): 0.0067 (SE = n/a)
tau (square root of estimated tau^2 value):      0.0817
I^2 (total heterogeneity / total variability):   39.47%
H^2 (total variability / sampling variability):  1.65

Test for Heterogeneity:
Q(df = 9) = 14.8695, p-val = 0.0946

Model Results:

     name  estimate     se  z-score  p-value  ci_0.025  ci_0.975
intercept   -0.0037 0.1330  -0.0278   0.9778   -0.2643    0.2569
      age    0.0003 0.0016   0.1781   0.8586   -0.0028    0.0033
 n_houses    0.0140 0.0186   0.7507   0.4528   -0.0225    0.0505

---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

tsalo avatar Jun 03 '22 17:06 tsalo