Documentation
¶
Index ¶
- func DefaultEngineModelSettings() map[string]string
- func GenerateMetaforScript(run AnalysisRun) string
- func MetaRegressionValuesFromEvidence(items []evidence.EvidenceItem, field string) (map[string]float64, error)
- func SubgroupValuesFromEvidence(items []evidence.EvidenceItem, field string) (map[string]string, error)
- func WriteAnalysisArtifactManifest(path string, manifest AnalysisArtifactManifest) error
- type AnalysisArtifactManifest
- type AnalysisResult
- type AnalysisRun
- func ExcludeByViSource(run AnalysisRun, viSource string) AnalysisRun
- func Prepare(id string, items []evidence.EvidenceItem) (AnalysisRun, error)
- func PrepareRawContinuous(id string, items []evidence.EvidenceItem, varianceFloor float64, ...) (AnalysisRun, error)
- func PrepareWithCalculator(id string, items []evidence.EvidenceItem, calc EffectSizeCalculator) (AnalysisRun, error)
- type Artifact
- type BayesianEngine
- type BayesianEngineOptions
- type BayesianReport
- type DisagreementResolution
- type EffectSizeCalculator
- type EngineComparisonReport
- type EngineOutputDeltas
- type EngineResult
- type EngineWarning
- type EnvironmentLock
- type FakeRunner
- type FisherZCorrelation
- type GridBayesianEngine
- type HeterogeneityMetrics
- type InfluenceReport
- type InfluenceRow
- type InputRow
- type LeaveOneOutRow
- type LogOddsRatio
- type MeanDifference
- type MetaRegressionReport
- type MethodCategory
- type MethodComparisonReport
- type MethodComparisonWorkbench
- func (w MethodComparisonWorkbench) Compare(category string, names []string) MethodComparisonReport
- func (w MethodComparisonWorkbench) CompareWithSelection(category string, names []string, selection MethodSelectionInput) MethodComparisonReport
- func (w MethodComparisonWorkbench) OptionsByCategory(category string) []MethodOption
- type MethodLockSelection
- type MethodOption
- type MethodSelectionInput
- type ModeratorField
- type ModeratorPreview
- type PlotArtifactManifest
- type PublicationBiasReport
- type RawContinuousOutcome
- type RawContinuousResult
- type ReadinessIssue
- type ReadinessReport
- type ReportEmbeddingMetadata
- type RiskDifference
- type RiskRatio
- type RscriptRunner
- type RunOutput
- type Runner
- type Scaffold
- type ScriptArtifactManifest
- type SensitivityReport
- type StandardizedMeanDifference
- type SubgroupEstimate
- type SubgroupReport
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GenerateMetaforScript ¶
func GenerateMetaforScript(run AnalysisRun) string
func WriteAnalysisArtifactManifest ¶
func WriteAnalysisArtifactManifest(path string, manifest AnalysisArtifactManifest) error
Types ¶
type AnalysisArtifactManifest ¶
type AnalysisArtifactManifest struct {
SchemaVersion string `json:"schemaVersion"`
RunID string `json:"runId"`
Plots []PlotArtifactManifest `json:"plots"`
Script ScriptArtifactManifest `json:"script"`
EngineVersions map[string]string `json:"engineVersions"`
Warnings []string `json:"warnings,omitempty"`
ReportEmbedding []ReportEmbeddingMetadata `json:"reportEmbedding"`
}
func NewAnalysisArtifactManifest ¶
func NewAnalysisArtifactManifest(run AnalysisRun, result AnalysisResult) AnalysisArtifactManifest
type AnalysisResult ¶
type AnalysisResult struct {
Versions map[string]string
ScriptChecksum string
OutputChecksum string
Warnings []string
ForestPlot Artifact
FunnelPlot Artifact
Metrics HeterogeneityMetrics
MetaRegression Scaffold
SubgroupAnalysis Scaffold
PublicationBias Scaffold
SensitivityAnalysis Scaffold
}
func RunMetafor ¶
func RunMetafor(dir string, run AnalysisRun, runner Runner) (AnalysisResult, error)
type AnalysisRun ¶
func ExcludeByViSource ¶ added in v0.1.6
func ExcludeByViSource(run AnalysisRun, viSource string) AnalysisRun
ExcludeByViSource returns a copy of run omitting rows whose ViSource equals the given tag.
func Prepare ¶
func Prepare(id string, items []evidence.EvidenceItem) (AnalysisRun, error)
func PrepareRawContinuous ¶ added in v0.1.6
func PrepareRawContinuous(id string, items []evidence.EvidenceItem, varianceFloor float64, moderatorFields []string) (AnalysisRun, error)
PrepareRawContinuous builds an AnalysisRun for scientific benchmarking meta-analysis. It records ViSource provenance per row and copies moderatorFields from evidence values.
func PrepareWithCalculator ¶
func PrepareWithCalculator(id string, items []evidence.EvidenceItem, calc EffectSizeCalculator) (AnalysisRun, error)
type BayesianEngine ¶
type BayesianEngine interface {
Name() string
Run(AnalysisRun, BayesianEngineOptions) (BayesianReport, error)
}
type BayesianEngineOptions ¶
type BayesianEngineOptions struct{ PriorMean, PriorVariance float64 }
type BayesianReport ¶
type BayesianReport struct {
RunID string `json:"runId"`
Method string `json:"method"`
Engine string `json:"engine,omitempty"`
Studies int `json:"studies"`
PriorMean float64 `json:"priorMean"`
PriorVariance float64 `json:"priorVariance"`
PosteriorMean float64 `json:"posteriorMean"`
PosteriorVar float64 `json:"posteriorVariance"`
CredibleLow95 float64 `json:"credibleLow95"`
CredibleHigh95 float64 `json:"credibleHigh95"`
}
BayesianReport records a lightweight normal-normal Bayesian meta-analysis approximation.
func BayesianNormalApproximation ¶
func BayesianNormalApproximation(run AnalysisRun, priorMean, priorVariance float64) (BayesianReport, error)
BayesianNormalApproximation computes a conjugate normal fixed-effect approximation.
func RunBayesianEngine ¶
func RunBayesianEngine(run AnalysisRun, engine BayesianEngine, opts BayesianEngineOptions) (BayesianReport, error)
type DisagreementResolution ¶
type EffectSizeCalculator ¶
type EngineComparisonReport ¶
type EngineComparisonReport struct {
SchemaVersion string `json:"schemaVersion"`
RunID string `json:"runId"`
PrimaryEngine string `json:"primaryEngine"`
SecondaryEngine string `json:"secondaryEngine"`
InputHash string `json:"inputHash"`
EnvironmentLocks []EnvironmentLock `json:"environmentLocks"`
ModelSettingParity bool `json:"modelSettingParity"`
ModelSettings map[string]string `json:"modelSettings"`
Warnings []EngineWarning `json:"warnings,omitempty"`
OutputDeltas EngineOutputDeltas `json:"outputDeltas"`
Disagreement DisagreementResolution `json:"disagreement"`
}
func CompareAnalysisEngines ¶
func CompareAnalysisEngines(run AnalysisRun, primary, secondary EngineResult, tolerance float64) EngineComparisonReport
type EngineOutputDeltas ¶
type EngineResult ¶
type EngineResult struct {
Engine string `json:"engine"`
Estimate float64 `json:"estimate"`
Variance float64 `json:"variance"`
InputHash string `json:"inputHash"`
Versions map[string]string `json:"versions"`
Warnings []string `json:"warnings,omitempty"`
ModelSettings map[string]string `json:"modelSettings"`
}
func BuildMetaforFixtureResult ¶
func BuildMetaforFixtureResult(run AnalysisRun, result AnalysisResult) (EngineResult, error)
func BuildPyMAREFixtureResult ¶
func BuildPyMAREFixtureResult(run AnalysisRun, estimateDelta float64) (EngineResult, error)
type EngineWarning ¶
type EnvironmentLock ¶
type FakeRunner ¶
func (FakeRunner) ToolVersions ¶
func (f FakeRunner) ToolVersions() map[string]string
type FisherZCorrelation ¶
type FisherZCorrelation struct{}
type GridBayesianEngine ¶
type GridBayesianEngine struct{ GridPoints int }
func (GridBayesianEngine) Name ¶
func (GridBayesianEngine) Name() string
func (GridBayesianEngine) Run ¶
func (g GridBayesianEngine) Run(run AnalysisRun, opts BayesianEngineOptions) (BayesianReport, error)
type HeterogeneityMetrics ¶
func ParseHeterogeneity ¶
func ParseHeterogeneity(output string) (HeterogeneityMetrics, error)
type InfluenceReport ¶
type InfluenceReport struct {
RunID string `json:"runId"`
BaselineEstimate float64 `json:"baselineEstimate"`
BaselineVariance float64 `json:"baselineVariance"`
Rows []InfluenceRow `json:"rows"`
}
func InfluenceDiagnostics ¶
func InfluenceDiagnostics(run AnalysisRun) (InfluenceReport, error)
type InfluenceRow ¶
type LeaveOneOutRow ¶
type LeaveOneOutRow struct {
OmittedPaperID string `json:"omittedPaperId"`
Estimate float64 `json:"estimate"`
Variance float64 `json:"variance"`
Delta float64 `json:"delta"`
AbsoluteDelta float64 `json:"absoluteDelta"`
Studies int `json:"studies"`
}
LeaveOneOutRow is one leave-one-study-out sensitivity result.
type LogOddsRatio ¶
type LogOddsRatio struct{}
type MeanDifference ¶
type MeanDifference struct{}
type MetaRegressionReport ¶
type MetaRegressionReport struct {
RunID string `json:"runId"`
Moderator string `json:"moderator"`
Studies int `json:"studies"`
Intercept float64 `json:"intercept"`
Slope float64 `json:"slope"`
}
MetaRegressionReport records a simple weighted meta-regression diagnostic.
func MetaRegression ¶
func MetaRegression(run AnalysisRun, moderator string, values map[string]float64) (MetaRegressionReport, error)
MetaRegression fits a weighted linear regression of effect size on a numeric moderator.
type MethodCategory ¶
type MethodCategory struct {
Name string `json:"name"`
Options []MethodOption `json:"options"`
}
type MethodComparisonReport ¶
type MethodComparisonReport struct {
Category string `json:"category"`
Options []MethodOption `json:"options"`
RequiresReviewerChoice bool `json:"requiresReviewerChoice"`
Recommendation string `json:"recommendation"`
LockedSelection MethodLockSelection `json:"lockedSelection,omitempty"`
}
type MethodComparisonWorkbench ¶
type MethodComparisonWorkbench struct {
SchemaVersion string `json:"schemaVersion"`
GeneratedFrom string `json:"generatedFrom"`
Categories []MethodCategory `json:"categories"`
}
func DefaultMethodComparisonWorkbench ¶
func DefaultMethodComparisonWorkbench() MethodComparisonWorkbench
func (MethodComparisonWorkbench) Compare ¶
func (w MethodComparisonWorkbench) Compare(category string, names []string) MethodComparisonReport
func (MethodComparisonWorkbench) CompareWithSelection ¶
func (w MethodComparisonWorkbench) CompareWithSelection(category string, names []string, selection MethodSelectionInput) MethodComparisonReport
func (MethodComparisonWorkbench) OptionsByCategory ¶
func (w MethodComparisonWorkbench) OptionsByCategory(category string) []MethodOption
type MethodLockSelection ¶
type MethodOption ¶
type MethodSelectionInput ¶
type ModeratorField ¶
type ModeratorPreview ¶
type ModeratorPreview struct {
Fields []ModeratorField `json:"fields"`
}
func ModeratorPreviewFromEvidence ¶
func ModeratorPreviewFromEvidence(items []evidence.EvidenceItem) ModeratorPreview
type PlotArtifactManifest ¶
type PublicationBiasReport ¶
type PublicationBiasReport struct {
RunID string `json:"runId"`
Method string `json:"method"`
Studies int `json:"studies"`
Intercept float64 `json:"intercept,omitempty"`
Slope float64 `json:"slope,omitempty"`
KendallTau float64 `json:"kendallTau,omitempty"`
Warning string `json:"warning,omitempty"`
}
PublicationBiasReport records a lightweight publication-bias diagnostic.
func BeggRankCorrelation ¶
func BeggRankCorrelation(run AnalysisRun) (PublicationBiasReport, error)
func EggerRegression ¶
func EggerRegression(run AnalysisRun) (PublicationBiasReport, error)
EggerRegression computes an Egger-style regression of standardized effects on precision.
type RawContinuousOutcome ¶ added in v0.1.6
type RawContinuousOutcome struct {
VarianceFloor float64 // floor vi when no CI or SE is reported; defaults to 0.0025
}
RawContinuousOutcome pools a single continuous metric per study (e.g., STH efficiency %). It implements EffectSizeCalculator for use with PrepareWithCalculator and also exposes CalculateRaw for PrepareRawContinuous, which also records ViSource and Moderators.
func (RawContinuousOutcome) CalculateRaw ¶ added in v0.1.6
func (r RawContinuousOutcome) CalculateRaw(values map[string]string) (RawContinuousResult, error)
CalculateRaw returns the full result including ViSource provenance tag.
type RawContinuousResult ¶ added in v0.1.6
RawContinuousResult holds the output of a single raw-continuous effect calculation.
type ReadinessIssue ¶ added in v0.1.6
type ReadinessIssue struct {
PaperID string `json:"paperId"`
MissingField string `json:"missingField"`
}
ReadinessIssue records a missing required field for one accepted evidence item.
type ReadinessReport ¶ added in v0.1.6
type ReadinessReport struct {
RunID string `json:"runId"`
Ready bool `json:"ready"`
TotalItems int `json:"totalItems"`
ReadyItems int `json:"readyItems"`
Issues []ReadinessIssue `json:"issues"`
}
ReadinessReport summarises whether all accepted evidence items carry the required fields.
func BenchmarkingReadiness ¶ added in v0.1.6
func BenchmarkingReadiness(runID string, items []evidence.EvidenceItem, requiredFields []string) ReadinessReport
BenchmarkingReadiness checks that every accepted evidence item has all requiredFields populated. Pass nil requiredFields to use the default STH% set.
type ReportEmbeddingMetadata ¶
type RiskDifference ¶
type RiskDifference struct{}
type RscriptRunner ¶
type RscriptRunner struct {
// Path is the Rscript binary to invoke; it defaults to "Rscript" (resolved
// from PATH) when empty.
Path string
// Timeout bounds a single Rscript execution; it defaults to 5 minutes.
Timeout time.Duration
}
RscriptRunner executes generated metafor scripts with a real Rscript binary. It implements Runner for opt-in R/metafor integration runs; the deterministic FakeRunner remains the default for normal, network-free tests.
func (RscriptRunner) Run ¶
func (r RscriptRunner) Run(script string) (RunOutput, error)
Run writes the metafor script to a temporary file and executes it with Rscript, capturing stdout and stderr. Arguments are passed directly (no shell), so the script content cannot inject extra commands.
func (RscriptRunner) ToolVersions ¶
func (r RscriptRunner) ToolVersions() map[string]string
ToolVersions reports the detected R version on a best-effort basis; it returns an empty map when the Rscript binary is unavailable.
type ScriptArtifactManifest ¶
type SensitivityReport ¶
type SensitivityReport struct {
RunID string `json:"runId"`
Method string `json:"method"`
BaselineEstimate float64 `json:"baselineEstimate"`
BaselineVariance float64 `json:"baselineVariance"`
MaxAbsoluteDelta float64 `json:"maxAbsoluteDelta"`
Rows []LeaveOneOutRow `json:"rows"`
}
SensitivityReport records deterministic sensitivity-analysis artifacts.
func LeaveOneOut ¶
func LeaveOneOut(run AnalysisRun) (SensitivityReport, error)
LeaveOneOut computes inverse-variance fixed-effect estimates after omitting each study.
type StandardizedMeanDifference ¶
type StandardizedMeanDifference struct{}
type SubgroupEstimate ¶
type SubgroupEstimate struct {
Group string `json:"group"`
Studies int `json:"studies"`
Estimate float64 `json:"estimate"`
Variance float64 `json:"variance"`
}
SubgroupEstimate is one inverse-variance pooled subgroup estimate.
type SubgroupReport ¶
type SubgroupReport struct {
RunID string `json:"runId"`
Variable string `json:"variable"`
Groups []SubgroupEstimate `json:"groups"`
}
SubgroupReport records pooled estimates split by a categorical moderator.
func SubgroupAnalysis ¶
func SubgroupAnalysis(run AnalysisRun, variable string, groups map[string]string) (SubgroupReport, error)
SubgroupAnalysis computes fixed-effect inverse-variance pooled estimates per group.