-
Notifications
You must be signed in to change notification settings - Fork 0
Regression
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.
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
--printoptions.
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.
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.
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.
crisp --inp crisp_input --ml --regression --out crisp_inputPrint stored metadata:
crisp --inp crisp_input --print metadata --print regression_coefficients
crisp --inp crisp_input --print metadata --print regression_summaryUse regression_analysis to retrieve coefficients and model fit statistics for interactive interpretation with AI assistants.
- Standardize predictors when scales differ to improve comparability.
- Link high-magnitude coefficients to qualitative categories (e.g., a strong positive coefficient for
travel_timeand narratives emphasizing "exhaustion" may refine a theoretical code about resource strain). - Negative coefficients may reveal protective factors emerging narratively as coping strategies.
- 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.
- 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.
- 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.
- Mettler et al. (2025) — Computational text analysis reflection.
- Statistical learning literature: Hastie, Tibshirani, Friedman (for potential future enhancements).