Skip to content

Regression

Bell Eapen edited this page Nov 10, 2025 · 1 revision

Regression

Overview

Regression analysis in CRISP-T supports confirmatory triangulation by quantifying associations between numeric predictors and an outcome while allowing integration with qualitative insights obtained from textual analysis (topics, sentiment, keyword categories). Both linear and logistic regression are supported depending on the nature of the outcome variable (continuous vs. binary). The method is intended not merely for prediction but for explicating relationships that can be theoretically framed within grounded theory.

Implementation in Repository

The --regression flag (as part of --ml) activates regression modeling within the analytical CLI. The MCP server exposes regression_analysis returning coefficients, standard interpretations, and model metadata. Automatically:

  • Detects binary outcomes and switches to logistic regression.
  • Stores regression coefficients and performance metrics (e.g., accuracy for logistic, R² for linear) in corpus metadata.
  • Allows subsequent printing with --print options.

Sense-making and Triangulation

Within grounded theory, theoretical saturation involves validating emergent concepts against empirical indicators. Regression coefficients:

  • Provide directionality (positive/negative association) that can be compared with qualitative memos.
  • Facilitate selective coding by identifying which quantitative dimensions substantively enrich core categories.
  • Help discriminate between competing explanatory categories when multiple qualitative themes overlap.

Example (Business Domain)

A corpus of product reviews (text) linked to a dataset of usage metrics seeks factors driving renewal_probability. Topics associated with "ease of integration" appear. A logistic regression shows api_errors_rate coefficient negative and significant, while training_hours positive. Researchers integrate: narratives about integration challenges align with quantitative penalty from error rate, reinforcing a proposition about technological friction affecting renewal.

Example (Medical Domain)

Patient narratives + clinical metrics used to model continuous fatigue_score. Linear regression yields positive coefficients for inflammation_marker and negative for sleep_balance. Qualitative themes about "unrestful sleep" and "persistent inflammation" triangulate with quantitative associations, supporting an emerging explanatory model of fatigue etiology.

Usage

CLI

crisp --inp crisp_input --ml --regression --out crisp_input

Print stored metadata:

crisp --inp crisp_input --print metadata --print regression_coefficients
crisp --inp crisp_input --print metadata --print regression_summary

MCP Server

Use regression_analysis to retrieve coefficients and model fit statistics for interactive interpretation with AI assistants.

Interpreting Coefficients

  1. Standardize predictors when scales differ to improve comparability.
  2. Link high-magnitude coefficients to qualitative categories (e.g., a strong positive coefficient for travel_time and narratives emphasizing "exhaustion" may refine a theoretical code about resource strain).
  3. Negative coefficients may reveal protective factors emerging narratively as coping strategies.

Model Diagnostics

  • For linear regression: examine R² and residual patterns; heteroscedasticity can indicate missing qualitative categories capturing structural variance.
  • For logistic regression: inspect odds ratios; use them to articulate conditional propositions ("Patients with sleep_balance < threshold are X times more likely to report high fatigue.").
  • Multicollinearity (high VIFs) may signal overlapping qualitative categories requiring consolidation in theoretical coding.

Limitations & Considerations

  • Regression assumes linear relationships; non-linearity may require transformation or alternative models (Random Forests) — see Future Plan.
  • Sparse or noisy textual-derived numeric features (e.g., keyword frequency counts) can destabilize coefficients.
  • Small sample sizes risk overfitting and threaten theoretical saturation; triangulate with robustness checks.

Recommended Extensions

  • Add regularized models (Lasso/Ridge) to support variable selection with many derived textual predictors.
  • Implement mixed-effects models for hierarchical corpora (e.g., clinician vs. patient narratives) — candidate for Future Plan.

References

  • Mettler et al. (2025) — Computational text analysis reflection.
  • Statistical learning literature: Hastie, Tibshirani, Friedman (for potential future enhancements).

See Also

Clone this wiki locally