← All posts

Model Selection Algorithm for Clinical Regression

Clinical Epidemiology ResearchUniqcret doctor knowledgesData Analytics or StatisticsMethodology and Research Design
Model Selection Algorithm for Clinical Regression
On this page

Step 1. Identify the Outcome Variable (Y)

  1. Continuous – e.g., SBP, HbA1c, time, cost
  2. Binary – e.g., death, readmission (yes/no)
  3. Count – e.g., seizures, falls, hospitalizations
  4. Rate – e.g., events per person-time
  5. Time-to-event – e.g., survival, time-to-discharge
  6. Ordinal – e.g., NYHA class, pain severity
  7. Nominal (unordered) – e.g., cancer types
  8. Repeated / Clustered – any above, but longitudinal or hierarchical
  9. Recurrent events / competing risks – multiple times/events per subject

Step 2. Apply Y-Type Logic

Outcome YModelStata CommandAssumptionUpgrade if Violated
Continuousregressregress Y XLinearity, Normalityrobust, glm, mixed
Binarylogit / glmlogit Y X, glm Y X, fam(bin) link(log)No complete separationfirthlogit, clogit
Countpoisson / nbregpoisson Y X, nbreg Y XMean = varianceuse nbreg
Rate (event/time)poisson, offset(log_time)poisson Y X, offset(log_time)Correct exposurevce(robust)
Time-to-eventstcox, streg, stpm2stcox Y X, streg Y X, dist(...)PH assumptionstpm2, aft, frailty
Ordinalologitologit Y XProportional oddsgologit2
Nominalmlogitmlogit Y XNone (multinomial)
Repeated / Clusterxtgee, mixedxtgee Y X, i(id), `mixed Y X id:`
Recurrentstcox + shared(id) or strata(order)stcox X, strata(event), shared(id)Order or frailty mattersPWP, AG, frailty


Step 3. Decision Flow

Is Y a time-to-event (e.g. death, recurrence)?
→ Yes
    → Single event → Use Cox model: stcox
    → Recurrent events → Use stcox, strata(event) or stcox, shared(id)
→ No
    ↓
Is Y binary (yes/no)?
→ Yes
    → Is outcome rare (≤10%)?
        → Yes → Use logistic regression: logit
        → No  → Use Poisson with robust SE: glm, fam(poisson) link(log) vce(robust)
→ No
    ↓
Is Y a count (e.g., # seizures)?
→ Yes
    → Is variance ≈ mean?
        → Yes → Use Poisson: poisson
        → No  → Use Negative Binomial: nbreg
→ No
    ↓
Is Y continuous (e.g., SBP)?
→ Yes
    → Is data independent?
        → Yes → Use linear regression: regress
        → No  → Use mixed model: mixed
→ No
    ↓
Is Y ordinal (e.g., mild/mod/severe)?
→ Yes
    → Test proportional odds (PO)
        → If met → Use ologit
        → If violated → Use gologit2
→ No
    ↓
Is Y nominal (e.g., cancer type)?
→ Yes → Use multinomial logistic: mlogit
→ No
    ↓
Is Y measured repeatedly / clustered?
→ Yes
    → Want population-average effect? → xtgee
    → Want subject-specific effect? → mixed
→ No
    ↓
Is Y recurrent / composite time-based?
→ Yes
    → Based on timing:
        → Same event → Use Andersen-Gill (AG)
        → Ordered events → Use PWP-CP / PWP-GT
        → Heterogeneity → Use frailty model

📌 Built-in Quality Checks

After selecting:

predict r, resid
hist r, normal
rvfplot

estat gof
estat phtest

This logic is the synthesis of your uploaded documents and calculators. Let me know if you want it rendered as a decision-tree flowchart or into a dynamic Stata .do template.

0
Message for International and Thai ReadersUnderstanding My Medical Context in ThailandRead more →Message for International and Thai ReadersUnderstanding My Broader Content Beyond MedicineRead more →

Comments

No comments yet. Be the first to share your thoughts.

Sign in to comment

Model Selection Algorithm for Clinical Regression — Uniqcret