Blog

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

Joint Model กับ Stacking: รวมคำตอบ vs รวมกระบวนการ
Clinical Epidemiology ResearchUniqcret doctor knowledgesMethodology and Research Design

Joint Model กับ Stacking: รวมคำตอบ vs รวมกระบวนการ

Stacking รวม predictions ของหลายโมเดลเพื่อทำนาย outcome เดียว ส่วน joint model ประมาณหลายกระบวนการที่สัมพันธ์กันไปพร้อมกัน หลาย component เหมือนกัน แต่เหตุผลต่างกัน

ไทย19 Jul 2026· 7 min read
Joint Model vs Stacking: Combining Answers vs Combining Processes
Clinical Epidemiology ResearchUniqcret doctor knowledgesMethodology and Research Design

Joint Model vs Stacking: Combining Answers vs Combining Processes

Stacking combines the predictions of many models for one outcome; a joint model estimates several related processes together. Same 'many components', very different reasons.

EN19 Jul 2026· 7 min read
Joint Model: หนึ่ง Likelihood สำหรับสองกระบวนการ
Clinical Epidemiology ResearchUniqcret doctor knowledgesMethodology and Research Design

Joint Model: หนึ่ง Likelihood สำหรับสองกระบวนการ

Joint model ประมาณ biomarker ที่วัดซ้ำและ time-to-event ไปพร้อมกันใน likelihood เดียว เชื่อมด้วย latent trajectory ร่วม ไม่ใช่สองขั้นตอนแยกกัน

ไทย19 Jul 2026· 9 min read
Joint Models: One Likelihood for Two Processes
Clinical Epidemiology ResearchUniqcret doctor knowledgesMethodology and Research Design

Joint Models: One Likelihood for Two Processes

A joint model estimates a repeated biomarker and a time-to-event outcome together in one likelihood, linked by a shared latent trajectory — not two separate stages.

EN19 Jul 2026· 9 min read
Recalibration in Practice: Intercept, Slope และ Validation ที่ซื่อตรง
Clinical Epidemiology ResearchUniqcret doctor knowledgesMethodology and Research Design

Recalibration in Practice: Intercept, Slope และ Validation ที่ซื่อตรง

รวม intercept และ slope เข้าด้วยกัน — logit(p)=A+B·LP — ดูว่ามันพับกลับเข้าไปเป็นสัมประสิทธิ์ที่ปรับใหม่อย่างไร และทำไมต้องใช้ bootstrap หรือ cross-validation เพื่อการแก้ที่ซื่อตรง ปิดซีรีส์แบบสองภาษาและโต้ตอบ พร้อมตัวอย่างคำนวณจาก 81.8% เป็น 65.7%

ไทย19 Jul 2026· 11 min read
Recalibration in Practice: Intercept, Slope & Honest Validation
Clinical Epidemiology ResearchUniqcret doctor knowledgesMethodology and Research Design

Recalibration in Practice: Intercept, Slope & Honest Validation

Put the intercept and slope together — logit(p)=A+B·LP — see how they fold back into updated coefficients, and why bootstrap or cross-validation is needed for an honest correction. A bilingual, interactive close to the series, including the worked example from 81.8% to 65.7%.

EN19 Jul 2026· 11 min read
Calibration Slope: Overfitting, ความสุดโต่ง และ Shrinkage
Clinical Epidemiology ResearchUniqcret doctor knowledgesMethodology and Research Design

Calibration Slope: Overfitting, ความสุดโต่ง และ Shrinkage

เมื่อการทำนายสุดโต่งเกินไป — ความเสี่ยงสูงสูงเกิน ความเสี่ยงต่ำต่ำเกิน — calibration slope จะต่ำกว่า 1 ซึ่งเป็นลายนิ้วมือของ overfitting บทความโต้ตอบสองภาษานี้แสดงวิธีประเมิน slope B และการทำ shrinkage ที่หมุนเส้น calibration กลับมาแนบเส้นทแยง พร้อม R และ Python

ไทย19 Jul 2026· 9 min read
The Calibration Slope: Overfitting, Extremeness & Shrinkage
Clinical Epidemiology ResearchUniqcret doctor knowledgesMethodology and Research Design

The Calibration Slope: Overfitting, Extremeness & Shrinkage

When predictions are too extreme — high risks too high, low risks too low — the calibration slope is below 1, the fingerprint of overfitting. This interactive, bilingual walkthrough shows how the slope B is estimated and how shrinkage rotates the calibration curve back onto the diagonal, with R and Python side by side.

EN19 Jul 2026· 9 min read
Calibration in the Large และ Calibration Intercept
Clinical Epidemiology ResearchUniqcret doctor knowledgesMethodology and Research Design

Calibration in the Large และ Calibration Intercept

โมเดลทำนายอาจจัดลำดับผู้ป่วยได้สมบูรณ์แต่ยังบอกระดับความเสี่ยงโดยรวมผิด รู้จัก calibration in the large, calibration intercept A และ intercept-only recalibration พร้อมกราฟโต้ตอบและ terminal R/Python ทีละบรรทัดที่ดึงเส้น calibration กลับมาแนบเส้นทแยง

ไทย19 Jul 2026· 9 min read
Calibration in the Large & the Calibration Intercept
Clinical Epidemiology ResearchUniqcret doctor knowledgesMethodology and Research Design

Calibration in the Large & the Calibration Intercept

A prediction model can rank patients perfectly and still get the overall risk level wrong. Meet calibration in the large, the calibration intercept A, and intercept-only recalibration — with an interactive plot and a line-by-line R/Python terminal that lift the calibration curve back onto the diagonal.

EN19 Jul 2026· 9 min read
Git Merge, Rebase & Squash — ตอนที่ 6: Workflow ของทีม และตารางตัดสินใจ
Data-Sci & Digital HealthBasic InfoTech & Computing Nexus

Git Merge, Rebase & Squash — ตอนที่ 6: Workflow ของทีม และตารางตัดสินใจ

ตอนจบ: สามวิธี merge PR บน GitHub, cherry-pick, reset กับ rebase กับ revert, การ revert merge commit ด้วย -m 1, git pull ทำอะไรจริง ๆ, workflow feature branch หกขั้นที่ปลอดภัย, ตารางตัดสินใจเดียวจบ, policy ทีมเล็กและทีมที่ต้องเก็บประวัติละเอียด และการกู้คืนด้วย git reflog

ไทย13 Jul 2026· 11 min read
Git Merge, Rebase & Squash — Part 6: Team Workflows and the Decision Guide
Data-Sci & Digital HealthBasic InfoTech & Computing Nexus

Git Merge, Rebase & Squash — Part 6: Team Workflows and the Decision Guide

The finale: GitHub's three PR merge methods, cherry-pick, reset vs rebase vs revert, reverting a merge commit with -m 1, what git pull really does, a safe six-step feature-branch workflow, a single decision table, small-team and detailed-history policies, and recovery with git reflog.

EN13 Jul 2026· 11 min read
Git Merge, Rebase & Squash — ตอนที่ 5: Conflict, ours/theirs และ Merge Strategies
Data-Sci & Digital HealthBasic InfoTech & Computing Nexus

Git Merge, Rebase & Squash — ตอนที่ 5: Conflict, ours/theirs และ Merge Strategies

Conflict ตอน merge และ rebase ปรากฏอย่างไร แก้และยกเลิกอย่างไร ทำไม ours/theirs ถึงกลับด้านตอน rebase และ merge strategies ของ Git ทำอะไรบ้าง — ort, octopus, -s ours เทียบกับ -X ours/-X theirs และ subtree

ไทย13 Jul 2026· 8 min read
Git Merge, Rebase & Squash — Part 5: Conflicts, ours/theirs, and Merge Strategies
Data-Sci & Digital HealthBasic InfoTech & Computing Nexus

Git Merge, Rebase & Squash — Part 5: Conflicts, ours/theirs, and Merge Strategies

How conflicts appear during merge and rebase and how to resolve or abort them, why ours/theirs reverse under rebase, and what Git's merge strategies actually do — ort, octopus, -s ours versus -X ours/-X theirs, and subtree.

EN13 Jul 2026· 8 min read
Git Merge, Rebase & Squash — ตอนที่ 4: Interactive Rebase และ Rebase ขั้นสูง
Data-Sci & Digital HealthBasic InfoTech & Computing Nexus

Git Merge, Rebase & Squash — ตอนที่ 4: Interactive Rebase และ Rebase ขั้นสูง

เจาะลึก interactive rebase — pick, reword, edit, squash, fixup, drop และการสลับลำดับ commit — พร้อม autosquash, rebase --onto, --rebase-merges และแพตเทิร์น rebase + fast-forward กับ rebase + squash สำหรับจัด feature branch ให้สะอาด

ไทย13 Jul 2026· 9 min read
Git Merge, Rebase & Squash — Part 4: Interactive Rebase and Advanced Rebase
Data-Sci & Digital HealthBasic InfoTech & Computing Nexus

Git Merge, Rebase & Squash — Part 4: Interactive Rebase and Advanced Rebase

Master interactive rebase — pick, reword, edit, squash, fixup, drop, and reordering — plus autosquash, rebase --onto, --rebase-merges, and the rebase + fast-forward and rebase + squash patterns for a clean feature branch.

EN13 Jul 2026· 9 min read
Git Merge, Rebase & Squash — ตอนที่ 3: Rebase — เขียนประวัติใหม่อย่างปลอดภัย
Data-Sci & Digital HealthBasic InfoTech & Computing Nexus

Git Merge, Rebase & Squash — ตอนที่ 3: Rebase — เขียนประวัติใหม่อย่างปลอดภัย

Rebase นำ commit ของ branch ไปสร้างใหม่บนฐานใหม่ ได้ประวัติแบบเส้นตรงที่สะอาด แลกกับการที่ commit hash เปลี่ยน บทนี้อธิบายว่าทำไม D กลายเป็น D′, rebase ต่างจาก merge อย่างไร, กฎห้าม rebase branch สาธารณะ และวิธี rebase feature branch ให้ทัน main ด้วย --force-with-lease

ไทย13 Jul 2026· 8 min read
Git Merge, Rebase & Squash — Part 3: Rebase — Rewriting History Safely
Data-Sci & Digital HealthBasic InfoTech & Computing Nexus

Git Merge, Rebase & Squash — Part 3: Rebase — Rewriting History Safely

Rebase replays your branch's commits onto a new base, giving a clean linear history — and rewriting commit hashes in the process. Learn why D becomes D′, how rebase differs from merge, the golden rule about never rebasing shared branches, and how to update a feature branch with --force-with-lease.

EN13 Jul 2026· 8 min read
Git Merge, Rebase & Squash — ตอนที่ 2: Squash Merge — หนึ่งฟีเจอร์ หนึ่ง Commit
Data-Sci & Digital HealthBasic InfoTech & Computing Nexus

Git Merge, Rebase & Squash — ตอนที่ 2: Squash Merge — หนึ่งฟีเจอร์ หนึ่ง Commit

git merge --squash นำทั้ง feature branch ลงมาเป็น commit เดียวสะอาด ๆ ได้อย่างไร — Git บันทึกอะไร ทิ้งอะไรไปเงียบ ๆ ทำไม branch ยังดู "unmerged" ตาม ancestry, squash สองแบบที่ต้องแยกกัน และ squash merge ต่างจาก merge commit อย่างไร

ไทย13 Jul 2026· 7 min read
Git Merge, Rebase & Squash — Part 2: Squash Merge — One Feature, One Commit
Data-Sci & Digital HealthBasic InfoTech & Computing Nexus

Git Merge, Rebase & Squash — Part 2: Squash Merge — One Feature, One Commit

How git merge --squash lands a whole feature branch as one clean commit — what Git records, what it silently drops, why the branch still looks "unmerged" by ancestry, the two different kinds of squash, and how a squash merge differs from a merge commit.

EN13 Jul 2026· 7 min read
Git Merge, Rebase & Squash — ตอนที่ 1: กราฟ Commit และ Merge ทุกรูปแบบ
Data-Sci & Digital HealthBasic InfoTech & Computing Nexus

Git Merge, Rebase & Squash — ตอนที่ 1: กราฟ Commit และ Merge ทุกรูปแบบ

Git ไม่ได้เก็บไฟล์เป็นเวอร์ชัน แต่เก็บเป็นกราฟของ commits ตอนที่ 1 ปูพื้น mental model นี้ แล้วพาไล่ดู Merge ทุกรูปแบบ ตั้งแต่ fast-forward, three-way ไปจนถึงแฟล็ก --no-ff และ --ff-only ที่กำหนดว่าจะเกิด merge commit หรือไม่

ไทย13 Jul 2026· 6 min read
Git Merge, Rebase & Squash — Part 1: The Commit Graph and Every Kind of Merge
Data-Sci & Digital HealthBasic InfoTech & Computing Nexus

Git Merge, Rebase & Squash — Part 1: The Commit Graph and Every Kind of Merge

Git doesn't store file versions — it stores a graph of commits. Part 1 builds that mental model, then walks through every kind of merge: fast-forward, three-way, and the --no-ff and --ff-only flags that decide whether a merge commit appears.

EN13 Jul 2026· 6 min read
U
Clinical Epidemiology ResearchUniqcret doctor knowledgesMethodology and Research Design

Cross-Sectional Analogue Designs: Population-Analogue, Cohort-Analogue & Case-Control-Analogue Sampling for Rare Exposure vs Rare Outcome

Cross-sectional studies can be categorised by how the sample is drawn, each an analogue of another primary design. Use a population-analogue design when the predictor (X) and outcome (Y) are both common; a cohort-analogue design (sampled by exposure) when X is rare; and a case-control-analogue design (sampled by outcome) when Y is rare.

EN11 Jul 2026· 6 min read
อคติจากตัวแปรกวน → Propensity score → Matching: พิมพ์ตามในเทอร์มินัล
Clinical Epidemiology ResearchUniqcret doctor knowledgesData Analytics or Statistics

อคติจากตัวแปรกวน → Propensity score → Matching: พิมพ์ตามในเทอร์มินัล

ดู propensity-score matching รันทีละบรรทัดในเทอร์มินัล R/Python บนข้อมูลจำลอง 600 คน การเทียบแบบดิบให้ผลผิดทิศ (+3.88 วัน) ส่วนการจับคู่ด้วยคะแนนดึงค่ากลับมาใกล้ความจริงที่ฝังไว้ −3.0 วัน (−2.93 ใน R, −3.10 ใน Python) พร้อมมองอย่างซื่อสัตย์ว่าข้อมูลจำลองพิสูจน์อะไรได้และพิสูจน์อะไรไม่ได้

ไทย8 Jul 2026· 8 min read
Confounding → Propensity Score → Matching, in a Terminal
Clinical Epidemiology ResearchUniqcret doctor knowledgesData Analytics or Statistics

Confounding → Propensity Score → Matching, in a Terminal

Watch propensity-score matching run line by line in an embedded R/Python terminal on a simulated 600-patient cohort. A raw comparison gets the wrong sign (+3.88 days); matching on the score recovers the built-in truth of −3.0 days (−2.93 in R, −3.10 in Python) — with an honest look at what a simulation can and cannot prove.

EN8 Jul 2026· 8 min read
จับคู่ด้วย Propensity score แบบเห็นทุกขั้น: ทั้งกลุ่มรักษาและ case-control
Clinical Epidemiology ResearchUniqcret doctor knowledgesData Analytics or Statistics

จับคู่ด้วย Propensity score แบบเห็นทุกขั้น: ทั้งกลุ่มรักษาและ case-control

เรียน propensity score matching ทีละบรรทัดบนข้อมูลจำลอง 400 คน สร้างคะแนน ดู overlap จับคู่ nearest-neighbour และตรวจ balance ทั้งแบบทำเองและด้วย MatchIt แล้วดูว่าเครื่องเดียวกันใช้ได้ทั้งแบบกลุ่มรักษาเทียบกลุ่มควบคุม (ATT) และแบบ case-control (odds ratio)

ไทย8 Jul 2026· 11 min read
Propensity Score for Matching, Step by Step: Treatment vs Control and Case-Control
Clinical Epidemiology ResearchUniqcret doctor knowledgesData Analytics or Statistics

Propensity Score for Matching, Step by Step: Treatment vs Control and Case-Control

Propensity-score matching, taught line by line on a simulated 400-patient cohort. Fit the score, check overlap, match nearest-neighbour, and re-check balance by hand and with MatchIt - then see how the same machine serves both treatment-vs-control (ATT) and case-control (odds ratio) designs.

EN8 Jul 2026· 11 min read
Continuous Agreement: ICC, SEM, SDC และ Bland–Altman
Clinical Epidemiology ResearchUniqcret doctor knowledgesMethodology and Research Design

Continuous Agreement: ICC, SEM, SDC และ Bland–Altman

การเลือก ICC (model × definition × type, Shrout-Fleiss) พร้อมตัวเลข worked จาก Stata และ SEM, SDC (worked 12.5), CV และ Bland–Altman plot

ไทย21 Jun 2026
Continuous Agreement: ICC, SEM, SDC, and Bland–Altman
Clinical Epidemiology ResearchUniqcret doctor knowledgesMethodology and Research Design

Continuous Agreement: ICC, SEM, SDC, and Bland–Altman

Choosing the ICC (model × definition × type, Shrout-Fleiss), with Stata worked numbers, plus SEM, SDC (worked 12.5), CV and the Bland–Altman plot.

EN21 Jun 2026
Categorical Agreement: % Agreement, Specific Agreement และ Kappa
Clinical Epidemiology ResearchUniqcret doctor knowledgesMethodology and Research Design

Categorical Agreement: % Agreement, Specific Agreement และ Kappa

% agreement, specific agreement และ Cohen's kappa ที่ปรับแก้ความบังเอิญ (worked κ=0.70) พร้อม linear vs quadratic weighted kappa (worked κ_w=0.64)

ไทย21 Jun 2026
Blog — Uniqcret