Blog

1106 posts on clinical medicine, epidemiology, research methodology, statistics and code — in English and Thai. Filter by category and language, or search.

Learning path · เส้นทางการเรียนรู้

For medical studentsสำหรับนักศึกษาแพทย์

Build clinical understanding, interpret tests, and learn to read evidence one step at a time.

ปูพื้นฐานทางคลินิก แปลผลการตรวจ และฝึกอ่านหลักฐานทีละขั้น

Start learning · เริ่มเรียนรู้ →
Learning path · เส้นทางการเรียนรู้

For doctors (MD)สำหรับแพทย์

Start with a clinical question. Appraise the evidence, interpret diagnostic tests, and examine how prediction models apply to practice.

เริ่มจากคำถามในเวชปฏิบัติ ประเมินหลักฐาน แปลผลการตรวจวินิจฉัย และพิจารณาการใช้แบบจำลองพยากรณ์ในบริบททางคลินิก

Start learning · เริ่มเรียนรู้ →
Learning path · เส้นทางการเรียนรู้

For researchersสำหรับนักวิจัย

Follow a question from study design through analysis, prediction and evidence synthesis.

พัฒนาคำถามวิจัยตั้งแต่การออกแบบ การวิเคราะห์ การพยากรณ์ ไปจนถึงการสังเคราะห์หลักฐาน

Start learning · เริ่มเรียนรู้ →
ทำไม Logistic และ Conditional Logistic Regression จึงให้ Odds Ratio ต่างกัน?
Clinical Epidemiology ResearchMethodology and Research DesignUniqcret doctor knowledges

ทำไม Logistic และ Conditional Logistic Regression จึงให้ Odds Ratio ต่างกัน?

Matched Pairs 20 คู่ชุดเดียวกัน Ordinary Logistic Regression ได้ OR = 1.83 แต่ Conditional Logistic Regression ได้ OR = 4.00 ส่วนจะเชื่อค่าใดตัดสินจาก Study Design แบบ Risk-Set Sampling ไม่ใช่จากสมการ

ไทย12 Oct 2026· 22 min read
Why Do Logistic and Conditional Logistic Regression Give Different Odds Ratios?
Clinical Epidemiology ResearchMethodology and Research DesignUniqcret doctor knowledges

Why Do Logistic and Conditional Logistic Regression Give Different Odds Ratios?

The same 20 matched pairs give an odds ratio of 1.83 from ordinary logistic regression and 4.00 from conditional logistic regression. Which to believe is decided by the risk-set sampling design, not by the equations.

EN12 Oct 2026· 26 min read
IPTW แบบ stabilized หรือ unstabilized: สมดุลเท่ากันใน pseudo-population 200 คน หรือ 100 คน
Clinical Epidemiology ResearchMethodology and Research DesignUniqcret doctor knowledges

IPTW แบบ stabilized หรือ unstabilized: สมดุลเท่ากันใน pseudo-population 200 คน หรือ 100 คน

IPTW มุ่งให้สองกลุ่มมีการกระจายของ Confounders เหมือนกัน ไม่ใช่ให้น้ำหนักเท่ากัน ในผู้ป่วย 100 คน Unstabilized weight ทำได้ใน pseudo-population 200 คน และ Stabilized weight ทำได้ใน pseudo-population 100 คน

ไทย12 Oct 2026· 16 min read
Stabilized or Unstabilized IPTW: The Same Balance in a Pseudo-Population of 200 or 100
Clinical Epidemiology ResearchMethodology and Research DesignUniqcret doctor knowledges

Stabilized or Unstabilized IPTW: The Same Balance in a Pseudo-Population of 200 or 100

IPTW aims at the same confounder mix in both arms, not at equal weights. In 100 patients, unstabilized weights reach it in a pseudo-population of 200 and stabilized weights in one of 100.

EN12 Oct 2026· 18 min read
ทำความเข้าใจ VCE: Robust Standard Error, Sandwich Estimator และ vce(cluster id)
Clinical Epidemiology ResearchMethodology and Research DesignUniqcret doctor knowledges

ทำความเข้าใจ VCE: Robust Standard Error, Sandwich Estimator และ vce(cluster id)

การประมาณ coefficient กับการประมาณความไม่แน่นอนของมันเป็นคนละกระบวนการ ตั้งแต่ Standard Error ของค่าเฉลี่ยไปจนถึง Variance-Covariance Matrix, Bread และ Meat ของ Sandwich, ตัวอย่างโรงพยาบาล 100 แห่งที่คำนวณด้วยมือ, Modified Poisson Regression และ vce(cluster id)

ไทย12 Oct 2026· 30 min read
Understanding the VCE: Robust Standard Errors, the Sandwich Estimator and vce(cluster id)
Clinical Epidemiology ResearchMethodology and Research DesignUniqcret doctor knowledges

Understanding the VCE: Robust Standard Errors, the Sandwich Estimator and vce(cluster id)

A coefficient and its uncertainty are estimated separately: from the standard error of a mean to the variance-covariance matrix, the bread and meat of the sandwich, a 100-hospital example worked by hand, modified Poisson regression and vce(cluster id).

EN12 Oct 2026· 36 min read
สัมประสิทธิ์เท่าเดิม แต่ standard error ต่างกัน: คำนวณ sandwich estimator ด้วยมือ
Clinical Epidemiology ResearchMethodology and Research DesignUniqcret doctor knowledges

สัมประสิทธิ์เท่าเดิม แต่ standard error ต่างกัน: คำนวณ sandwich estimator ด้วยมือ

ข้อมูลจำนวนครั้งที่ผู้ป่วยเข้ารับการรักษาในโรงพยาบาลสองชุดเล็ก ๆ มี mean เท่ากัน Poisson regression จึงให้ coefficient เดียวกัน แต่ sandwich standard error ที่คำนวณ bread และ meat ด้วยมือแยกสองชุดนี้ออกจากกันได้

ไทย12 Oct 2026· 20 min read
Same Coefficient, Different Standard Error: The Sandwich Estimator Worked by Hand
Clinical Epidemiology ResearchMethodology and Research DesignUniqcret doctor knowledges

Same Coefficient, Different Standard Error: The Sandwich Estimator Worked by Hand

Two small sets of hospital admission counts share the same mean, so Poisson regression gives them the same coefficient, while the sandwich standard error, worked out bread and meat by hand, tells them apart.

ENupdated 12 Oct 2026· 24 min read
ปฏิกิริยาสัมพันธ์ (Interaction): อ่านที่ reference level ใด บน scale ใด
Clinical Epidemiology ResearchMethodology and Research DesignUniqcret doctor knowledges

ปฏิกิริยาสัมพันธ์ (Interaction): อ่านที่ reference level ใด บน scale ใด

เมื่อแบบจำลองมี interaction term ต้องอ่าน main effect ที่ reference level ของอีกตัวแปรหนึ่ง และข้อสรุปเรื่อง interaction ใช้ได้เฉพาะบน scale ที่ระบุ ความเสี่ยงสี่ค่าชุดเดียวกันอาจไม่มี interaction บน scale หนึ่ง แต่มีบนอีก scale หนึ่ง

ไทยupdated 8 Oct 2026· 15 min read
Interaction: At What Reference Level, on What Scale?
Clinical Epidemiology ResearchUniqcret doctor knowledgesMethodology and Research Design

Interaction: At What Reference Level, on What Scale?

With an interaction term, a main effect is read at the reference level of the other variable, and an interaction finding holds only on a named scale: the same four risks can show none on one scale and some on another.

ENupdated 8 Oct 2026· 17 min read
กลุ่มประชากรเดียวกัน แต่ Odds Ratio สองค่า: Non-Collapsibility ที่ไม่มีตัวกวนเกี่ยวข้อง
Clinical Epidemiology ResearchMethodology and Research DesignUniqcret doctor knowledges

กลุ่มประชากรเดียวกัน แต่ Odds Ratio สองค่า: Non-Collapsibility ที่ไม่มีตัวกวนเกี่ยวข้อง

cohort เดียวกัน วิเคราะห์ด้วย adjusted regression และ weighting ถูกต้องทั้งคู่ แต่ได้ odds ratio สองค่า เพราะสองวิธีอาจกำลังตอบคนละคำถาม

ไทยupdated 8 Oct 2026· 9 min read
Same Cohort, Two Odds Ratios: Non-Collapsibility Without Confounding
Clinical Epidemiology ResearchUniqcret doctor knowledgesData Analytics or Statistics

Same Cohort, Two Odds Ratios: Non-Collapsibility Without Confounding

One cohort, an adjusted regression and a weighted analysis, both done correctly, and two different odds ratios: the two methods may be answering different questions.

ENupdated 8 Oct 2026· 10 min read
หา Risk Ratio เมื่อผลลัพธ์พบบ่อย: ลำดับขั้นถอยลงเมื่อ Log-Binomial ชนกำแพง
Clinical Epidemiology ResearchMethodology and Research DesignUniqcret doctor knowledges

หา Risk Ratio เมื่อผลลัพธ์พบบ่อย: ลำดับขั้นถอยลงเมื่อ Log-Binomial ชนกำแพง

outcome เป็น binary ต้องรายงาน risk ratio แต่ log-binomial model ไม่ converge: ถอยลงไปใช้ modified Poisson พร้อม robust SE แล้วดูว่าทำไม log link จึงให้ risk ratio และกำแพงที่ risk เท่ากับ 1 มาจากไหน

ไทยupdated 8 Oct 2026· 24 min read
Getting a Risk Ratio for a Common Outcome: The Step-Down When Log-Binomial Hits the Wall
Clinical Epidemiology ResearchUniqcret doctor knowledgesData Analytics or Statistics

Getting a Risk Ratio for a Common Outcome: The Step-Down When Log-Binomial Hits the Wall

A binary outcome, a risk ratio to report and a log-binomial model that will not converge: step down to modified Poisson with a robust SE, and see why the log link gives the risk ratio and where the wall at a risk of 1 comes from.

ENupdated 8 Oct 2026· 29 min read
Link และ Family: ตัวหนึ่งกำหนดมาตรวัดผล อีกตัวกำหนดค่าคลาดเคลื่อนมาตรฐาน
Clinical Epidemiology ResearchMethodology and Research DesignUniqcret doctor knowledges

Link และ Family: ตัวหนึ่งกำหนดมาตรวัดผล อีกตัวกำหนดค่าคลาดเคลื่อนมาตรฐาน

เลือก effect measure ก่อน: link เป็นตัวบอกว่า coefficient หมายถึงอะไร family เป็นตัวกำหนด variance และกำแพงของ log link ที่ p = 1 อธิบายว่าทำไม log-binomial จึง fit ไม่สำเร็จในจุดที่ modified Poisson ไม่ติดปัญหา

ไทยupdated 8 Oct 2026· 23 min read
Link and Family: One Picks Your Effect Measure, the Other Your Standard Error
Clinical Epidemiology ResearchUniqcret doctor knowledgesMethodology and Research Design

Link and Family: One Picks Your Effect Measure, the Other Your Standard Error

Choose the effect measure first: the link then decides what the coefficient means, the family decides the variance, and the log link's wall at p = 1 explains why log-binomial fits fail where modified Poisson does not.

ENupdated 8 Oct 2026· 29 min read
Kaplan-Meier และ Cox สำหรับเหตุการณ์แรก: KM บรรยาย Cox สร้างแบบจำลอง
Clinical Epidemiology ResearchMethodology and Research DesignUniqcret doctor knowledges

Kaplan-Meier และ Cox สำหรับเหตุการณ์แรก: KM บรรยาย Cox สร้างแบบจำลอง

สำหรับเวลาจนเกิดเหตุการณ์แรก Kaplan-Meier บรรยายความน่าจะเป็นที่จะยังปลอดเหตุการณ์ ส่วนแบบจำลอง Cox ประมาณ hazard ratio และปรับตัวแปรร่วมได้เมื่อจำเป็น ตราบที่อัตราส่วนนั้นคงที่โดยประมาณตลอดเวลา

ไทยupdated 8 Oct 2026· 14 min read
Kaplan-Meier and Cox for a First Event: KM Describes, Cox Models
Clinical Epidemiology ResearchUniqcret doctor knowledgesMethodology and Research Design

Kaplan-Meier and Cox for a First Event: KM Describes, Cox Models

For the time to a first event, Kaplan-Meier describes the probability of staying event-free and the Cox model estimates the hazard ratio, adjusted if needed, as long as that ratio stays roughly constant.

ENupdated 8 Oct 2026· 16 min read
คำถามแบบเวลาจนเกิดเหตุการณ์: เหตุการณ์แรก เหตุการณ์แข่งขัน และเหตุการณ์ซ้ำ ต้องใช้แผนที่ต่างกัน
Clinical Epidemiology ResearchMethodology and Research DesignUniqcret doctor knowledges

คำถามแบบเวลาจนเกิดเหตุการณ์: เหตุการณ์แรก เหตุการณ์แข่งขัน และเหตุการณ์ซ้ำ ต้องใช้แผนที่ต่างกัน

ก่อนเลือก model สำหรับ time-to-event analysis ให้ถามสามคำถาม: สนใจเฉพาะ first event หรือไม่ event เกิดซ้ำได้หรือไม่ และมี event อื่นที่ขัดขวางไม่ให้ event ที่สนใจเกิดได้เลยหรือไม่ แต่ละคำตอบชี้ไปยังกลุ่มวิธีของตัวเอง

ไทยupdated 8 Oct 2026· 11 min read
Time-to-Event Questions: First Events, Competing Events and Recurrences Need Different Maps
Clinical Epidemiology ResearchUniqcret doctor knowledgesMethodology and Research Design

Time-to-Event Questions: First Events, Competing Events and Recurrences Need Different Maps

Before choosing a time-to-event model, ask three questions: is only the first event of interest, can the event recur, and can another event stop it from ever happening? Each answer points to its own family of methods.

ENupdated 8 Oct 2026· 12 min read
Marginal Structural Models: เมื่อตัวกวนวันนี้คือผลของการรักษาเมื่อวาน
Clinical Epidemiology ResearchMethodology and Research DesignUniqcret doctor knowledges

Marginal Structural Models: เมื่อตัวกวนวันนี้คือผลของการรักษาเมื่อวาน

severity วันที่ 2 ถูก steroid วันที่ 1 เปลี่ยนไปแล้ว และยังกำหนดทั้ง steroid ครั้งถัดไปและ mortality ordinary regression จึงติดทางตัน IPW ทำ treatment groups ให้ comparable แล้ว MSM จึงประมาณผลของ treatment strategy

ไทยupdated 8 Oct 2026· 11 min read
Marginal Structural Models: When Today's Confounder Is Yesterday's Treatment Effect
Clinical Epidemiology ResearchMethodology and Research DesignUniqcret doctor knowledges

Marginal Structural Models: When Today's Confounder Is Yesterday's Treatment Effect

Severity on day 2 is changed by the day-1 steroid and then decides both the next steroid dose and mortality, so ordinary regression is stuck; IPW makes the groups comparable and the MSM estimates the strategy effect.

ENupdated 8 Oct 2026· 14 min read
จาก IPTW สู่ IPSW: ใครได้รับการรักษา ใครได้เข้าการศึกษา
Clinical Epidemiology ResearchMethodology and Research DesignUniqcret doctor knowledges

จาก IPTW สู่ IPSW: ใครได้รับการรักษา ใครได้เข้าการศึกษา

IPTW และ IPSW ใช้แนวคิด inverse probability เดียวกัน แต่ตอบคนละคำถาม IPTW ถามว่าทำไมผู้ป่วยคนนี้ได้รับการรักษานี้ ส่วน IPSW ถามว่าทำไมผู้ป่วยคนนี้ได้เข้าการศึกษานี้

ไทยupdated 8 Oct 2026· 14 min read
From IPTW to IPSW: Who Gets the Treatment, Who Gets Into the Study
Clinical Epidemiology ResearchMethodology and Research DesignUniqcret doctor knowledges

From IPTW to IPSW: Who Gets the Treatment, Who Gets Into the Study

IPTW and IPSW share one inverse-probability idea but answer different questions: IPTW asks why a patient got this treatment, IPSW asks why a patient got into this study.

ENupdated 8 Oct 2026· 14 min read
เมื่อ IPTW สร้างน้ำหนักสุดโต่ง (extreme weights): วินิจฉัยก่อนแล้วค่อยประมาณผล
Clinical Epidemiology ResearchMethodology and Research DesignUniqcret doctor knowledges

เมื่อ IPTW สร้างน้ำหนักสุดโต่ง (extreme weights): วินิจฉัยก่อนแล้วค่อยประมาณผล

ผู้ป่วยกลุ่ม treated ที่ได้ weight 50 และผู้ป่วยกลุ่ม control ที่ได้ weight 100 ไม่ใช่ตัวเลขที่ควรเก็บกวาดทิ้ง แต่เป็นสัญญาณเตือนเรื่องการเปรียบเทียบ ที่ต้องหาสาเหตุให้ได้ก่อนประมาณ outcome ใด ๆ

ไทยupdated 8 Oct 2026· 13 min read
When IPTW Produces Extreme Weights: Diagnose Before You Estimate
Clinical Epidemiology ResearchMethodology and Research DesignUniqcret doctor knowledges

When IPTW Produces Extreme Weights: Diagnose Before You Estimate

A treated patient with a weight of 50 and a control patient with a weight of 100 are not numbers to tidy away; they are a warning about the comparison, to be investigated before any outcome is estimated.

ENupdated 8 Oct 2026· 15 min read
เมื่อ IPTW แล้วยังไม่ balance: ปรับ model หรือ weights แล้วตรวจ overlap และ balance ซ้ำ
Clinical Epidemiology ResearchMethodology and Research DesignUniqcret doctor knowledges

เมื่อ IPTW แล้วยังไม่ balance: ปรับ model หรือ weights แล้วตรวจ overlap และ balance ซ้ำ

หลังถ่วงน้ำหนัก ให้ตรวจ balance, overlap และ weights ก่อนอ่าน outcome ถ้า SMD ของ severity ยังเป็น 0.32 แปลว่าต้องปรับ model หรือ weights ส่วน overlap ที่ไม่ดีเป็นปัญหาที่การเพิ่มพจน์ใด ๆ ก็แก้ไม่ได้

ไทยupdated 8 Oct 2026· 16 min read
When IPTW Does Not Balance: Revise the Model or the Weights, Then Recheck Overlap and Balance
Clinical Epidemiology ResearchMethodology and Research DesignUniqcret doctor knowledges

When IPTW Does Not Balance: Revise the Model or the Weights, Then Recheck Overlap and Balance

After weighting, check balance, overlap and the weights before reading the outcome. A severity SMD of 0.32 means revise the model or the weights; poor overlap is a problem no added term can fix.

ENupdated 8 Oct 2026· 18 min read
IPTW: ทำให้กลุ่มการรักษาเปรียบเทียบกันได้ และตรวจว่าได้ผลจริง
Clinical Epidemiology ResearchMethodology and Research DesignUniqcret doctor knowledges

IPTW: ทำให้กลุ่มการรักษาเปรียบเทียบกันได้ และตรวจว่าได้ผลจริง

การถ่วงน้ำหนักเปลี่ยนว่าผู้ป่วยแต่ละคนนับเป็นเท่าไร ไม่ได้เปลี่ยนว่าใครอยู่ในข้อมูล บทความนี้แสดงว่า IPTW ทำให้กลุ่มการรักษาเปรียบเทียบกันได้ในลักษณะที่วัดได้อย่างไร และสามการตรวจที่บอกว่ามันได้ผล

ไทยupdated 8 Oct 2026· 12 min read
IPTW: Making Treatment Groups Comparable and Checking That It Worked
Clinical Epidemiology ResearchUniqcret doctor knowledgesMethodology and Research Design

IPTW: Making Treatment Groups Comparable and Checking That It Worked

Weighting changes how much each patient counts, not who is in the data. Here is how IPTW makes treatment groups comparable on measured characteristics, and the three checks that show it worked.

ENupdated 8 Oct 2026· 12 min read
Blog — Uniqcret