← All posts

GLM Families and Effect Measures: Choosing the Right Model for Y

Clinical Epidemiology ResearchUniqcret doctor knowledgesMethodology and Research DesignData Analytics or Statistics
GLM FamilyY: Data TypeLink Function / ModelEffect Measure
GaussianContinuous (e.g., BP, cholesterol)Linear regressionMean difference
 Positive, skewed continuousLog-linear regressionMean ratio
BinomialBinary outcome (e.g., disease/no disease)Logistic regression (logit link)Odds ratio (OR)
  Log-binomial regression (log link)Risk ratio (RR)
  Linear probability model (identity link)Risk difference (RD)
PoissonCount data, rate (rare events, no overdisp.)Poisson regression (log link)Incidence rate ratio (IRR)
Negative BinomialOverdispersed count data (variance > mean)Negative binomial regressionIRR (robust to overdispersion)
GammaPositive, skewed continuous (e.g., cost)Log-gamma regressionMean ratio
Survival (Time-to-event)Time until event (e.g., death, relapse)Cox model (semi-parametric)Hazard ratio (HR)
  Parametric survival models (Weibull, etc.)Hazard ratio (HR)

When you're building models in clinical research, the starting point is always this question:

What is the outcome variable (Y), and what is its nature?

That’s because your entire analysis strategy in Generalized Linear Models (GLMs) hinges on the Family of Y. Each “family” corresponds to a different type of outcome — continuous, binary, count, time-to-event — and brings its own logic for link function and interpretation.

Let’s walk through the 6 major GLM families, linking each one to:


🧮 1. Gaussian Family → For Continuous Outcomes

✅ When to use:

🔗 Link functions and models:

🎯 Effect measures:

🔍 Example:

"Does Drug A reduce average systolic blood pressure compared to Drug B?" Use linear regression → output interprets as mmHg difference in means.


⚫ 2. Binomial Family → For Binary Outcomes

✅ When to use:

🔗 Link functions and models:

🎯 Effect measures:

⚠️ Pitfall alert:

Odds ratio ≠ risk ratio. Use RR when prevalence is high to avoid OR inflation.

🔍 Example:

"Is smoking associated with MI?" Use log-binomial if feasible for RR, or logistic if convergence issues occur.


🔢 3. Poisson Family → For Rate Data (Count Outcomes)

✅ When to use:

🔗 Model:

🎯 Effect measure:

🔍 Example:

"Does ICU stay increase infection rates per 1000 catheter days?"


🧨 4. Negative Binomial Family → For Overdispersed Count Data

✅ When to use:

🔗 Model:

🎯 Effect measure:

🔍 Example:

"How does COPD affect number of ER visits?" Overdispersion is likely — negative binomial > Poisson.

Overdispersion

"Overdispersion" ในบริบททางสถิติ มีคำแปลและการนิยามดังนี้:

คำแปลภาษาไทย: ความแปรปรวนเกิน หรือ การกระจายตัวมากเกิน

นิยามและความหมาย

Overdispersion (ความแปรปรวนเกิน) คือปรากฏการณ์ทางสถิติที่เกิดขึ้นเมื่อความแปรปรวน (variance) ของข้อมูลที่สังเกตได้จริง สูงกว่า ความแปรปรวนที่คาดไว้ตามทฤษฎีของแบบจำลองความน่าจะเป็น (statistical probability model) ที่เลือกใช้

เพื่อให้เข้าใจง่ายขึ้น ลองดูบริบทที่พบบ่อยที่สุด:

1. ในแบบจำลองปัวซง (Poisson Model)

แบบจำลองปัวซงมักใช้สำหรับวิเคราะห์ข้อมูลประเภท "จำนวนนับ" (count data) เช่น จำนวนอุบัติเหตุต่อวัน, จำนวนลูกค้าที่เข้าร้านต่อชั่วโมง

  • ทฤษฎีของปัวซง: กำหนดว่า ค่าเฉลี่ย (μ) ต้องเท่ากับ ค่าความแปรปรวน (σ2) ⟹μ=σ2
  • ภาวะ Overdispersion: เมื่อนำข้อมูลจริงมาวิเคราะห์ พบว่า ค่าความแปรปรวน มากกว่า ค่าเฉลี่ย (σ2>μ)

ตัวอย่าง: สมมติเรานับจำนวนลูกค้าที่โทรเข้ามา call center ในแต่ละชั่วโมง

  • ค่าเฉลี่ยการโทร = 20 ครั้งต่อชั่วโมง
  • ตามทฤษฎีปัวซง ความแปรปรวนควรจะประมาณ 20 ด้วย
  • แต่ถ้าข้อมูลจริงแสดงให้เห็นว่า บางชั่วโมงมี 5 ครั้ง แต่บางชั่วโมงพุ่งไปถึง 50 ครั้ง ทำให้คำนวณความแปรปรวนได้ถึง 45 ⟹ นี่คือภาวะความแปรปรวนเกิน (45 > 20)

2. สาเหตุที่พบบ่อย

  • ความแตกต่างแฝง (Unobserved Heterogeneity): มีปัจจัยสำคัญที่ส่งผลต่อข้อมูลแต่ไม่ได้ถูกรวมไว้ในแบบจำลอง เช่น ในตัวอย่าง call center ข้างต้น อาจมีปัจจัยเรื่อง "ช่วงโปรโมชั่น" หรือ "ระบบล่ม" ที่ทำให้จำนวนการโทรผันผวนสูงกว่าปกติ
  • การขาดความเป็นอิสระต่อกัน (Lack of Independence): ข้อมูลบางกลุ่มอาจมีความสัมพันธ์กันเอง (correlation)

3. ผลกระทบหากไม่จัดการ

หากเพิกเฉยต่อภาวะ Overdispersion จะทำให้การประมาณค่าความคลาดเคลื่อนมาตรฐาน (Standard Errors) ของแบบจำลองต่ำกว่าความเป็นจริง ส่งผลให้ค่า p-value น้อยเกินไป และนำไปสู่การสรุปผลที่ผิดพลาดว่าตัวแปรนั้นมีนัยสำคัญทางสถิติ (Type I error)


💰 5. Gamma Family → For Skewed Continuous Outcomes

✅ When to use:

🔗 Model:

🎯 Effect measure:

🔍 Example:

"What’s the effect of surgical approach on hospital cost?"


⏱️ 6. Survival Family → For Time-to-Event Data

✅ When to use:

🔗 Models:

🎯 Effect measure:

🔍 Example:

"What’s the effect of chemotherapy on time to progression?"


✅ Final Takeaway: The GLM "Match Game"

Always choose your model based on Y. Here's the golden shortcut:

Y TypeGLM FamilyCommon ModelEffect Measure
Continuous (normal)GaussianLinear regressionMean difference
Skewed continuousGammaLog-gamma regressionMean ratio
BinaryBinomialLogistic / log-binomialOR / RR / RD
Count (rare, Poisson-like)PoissonPoisson regressionIRR
Count (overdispersed)Negative BinomialNeg. binomial regressionIRR
Time-to-eventSurvivalCox / parametric modelsHR