Posts

Making Apples-to-Apples Comparisons Between Internal and External Studies Using Propensity Scores (3)

Image
  Examples using SAS: SAS code 1: title 'PSMATCH: ATT Weighting'; proc psmatch data=t1 region=treated; class trt genotype; psmodel trt(Treated='study treatment')= b_age genotype b_var; where vsn=0; assess lps var=(b_age genotype b_var)/ weight=attwgt; output out(OBS=region)=Outex; run; SAS code 2: title 'PSMATCH: ATT Weighting'; proc psmatch data=t1 region=allobs(psmin=0.05 psmax=0.95); class trt genotype; psmodel trt(Treated='study treatment')= b_age genotype b_var; where vsn=0; assess lps var=(b_age genotype b_var)/ weight=attwgt; output out(OBS=region)=Outex1; Aspect region=treated region=allobs(psmin=0.05 psmax=0.95) Who gets dropped Controls outside treated PS range Both groups outside [0.05,0.95] Treated retention All treated kept Some treated may be dropped Target estimand ATT in full treated population ATT in trimmed treated population Weight stability / ESS Potentially lower ESS (more extreme weights) Typically highe...

Making Apples-to-Apples Comparisons Between Internal and External Studies Using Propensity Scores (2)

Image
  Propensity Score Weighting Method 1. What Is Propensity Score Weighting? Propensity score weighting  is a method used to  adjust for confounding  in observational studies or non-randomized comparisons (like  external control arms ) to create a "pseudo-population" in which treatment groups are  comparable  on baseline covariates. 🔑 The  propensity score (PS)  is defined as: e ( x ) = P ( T = 1 ∣ X = x ),  which is the probability of the treatment assignment conditional   on the set of confounding  variables X         where: T  is the treatment indicator (1 = treated, 0 = control) X  is a vector of observed baseline covariates 2. Why Use Weighting Instead of Matching or Stratification? Method Goal Use Case Matching       Select similar individuals                         Small sample studies, causal inference Stra...

Making Apples-to-Apples Comparisons Between Internal and External Studies Using Propensity Scores (1)

Image
  Propensity score analysis attempts to replicate the properties of a randomized trial with respect to the observed variables X . The following three methods are commonly used in propensity score analysis:  weighting, which creates weights that are appropriate for estimating the ATE and ATT  stratification, which creates strata based on propensity scores  matching, which matches treated units with control units. A propensity score analysis usually involves the following steps (Guo and Fraser 2015, p. 131): 1. You specify a set of confounding variables that might be related to both the treatment assignment and the outcome. 2. You use this set of variables to fit a logistic regression model and compute propensity scores. The response is the probability of assignment to the treated group. 3. You choose a propensity method (weighting, stratification, or matching) to compute observation weights (weighting), to construct strata of observations (stratification), or to ...

Covariate Selection in Clinical Trials: A Guide to Best Practices

Image
 When selecting covariates for analysis in a clinical trial, it's important to follow established guidelines to ensure the validity and reliability of your results. The process involves both clinical and statistical considerations, with a strong emphasis on pre-specification to avoid bias. Key Principles for Selecting Covariates Prior Knowledge and Prognostic Value : Select covariates that are known or expected to be strongly associated with the primary outcome based on existing scientific literature, data from previous trials (e.g., Phase 2), or strong clinical rationale. These are known as prognostic covariates. A classic example is using a patient's baseline blood pressure as a covariate when studying a new blood pressure medication. Pre-specification is Essential : The most critical rule is to prospectively specify the covariates and the adjustment method in the study protocol before any comparative data is unblinded. This prevents the biased "data-dependent" sel...

Why Treatment Assignment and Potential Outcomes Are Not Independent in Observational Studies ?

   Step-by-Step Explanation: 1. What Are Potential Outcomes? In causal inference , for each individual we define two potential outcomes : Y ( 0 ) Y(0) : the outcome the person would have if they did not receive the treatment. Y ( 1 ) Y(1) : the outcome the person would have if they did receive the treatment. 📌 These are hypothetical — for each person, we only get to observe one of them in real life (depending on their treatment assignment). 2. What Is T T ? T T  is the treatment assignment : T = 1 T = 1 : treated T = 0 T = 0 : control (not treated) 3. What Does "Not Independent" Mean? Saying that the potential outcomes ( Y ( 0 ) , Y ( 1 ) ) and  T T  are not independent means: The likelihood of receiving treatment depends on something that also affects the outcome . In math: ( Y ( 0 ) , Y ( 1 ))⊥T That is: the treatment assignment is related to the outcome you’d have had with or without treatment. 4. 🔄 Why Is...

Mastering PROC SQL: Essential Statements for Data Management

1.Joining Tables Example datasets: data sales; input id product $ amount; datalines; 1 A 100 2 B 150 3 C 200 ; run; data customer; input id name $; datalines; 1 John 2 Mary 4 Alex ; run; INNER JOIN (only matches) proc sql; select a.id, a.product, a.amount, b.name from sales as a inner join customer as b on a.id = b.id; quit; LEFT JOIN (all sales, add customer if match) proc sql; select a.id, a.product, a.amount, b.name from sales as a left join customer as b on a.id = b.id; quit; FULL JOIN (everything) proc sql; select a.id, a.product, a.amount, b.name from sales as a full join customer as b on a.id = b.id; quit; 2. Subqueries proc sql; select * from example where value = (select max(value) from example); quit; 🔹 Finds rows matching a nested query (here: the max value). 3. ON (JOIN condition) General Syntax proc sql; select a.col1, b.col2 from tableA as a join tableB as b on a.key = b.key; quit; tableA and tableB are data...

What Is a Rolling Baseline and How to Use ?

  What Is a Rolling Baseline? A  rolling baseline  refers to a flexible approach to defining the baseline time point for each participant, especially when participants are enrolled at different times or when baseline data is collected over a period rather than at a fixed time. In External Studies: External studies often use  real-world data  or  external control arms . A rolling baseline allows each subject’s  index date  (start of observation or treatment) to be defined individually, based on when they meet inclusion criteria or initiate treatment. This is especially useful when aligning external data with internal trial data for comparative analysis. 🧠 Why Use a Rolling Baseline? Variable Enrollment Timing : Participants may enter the study at different times, so a fixed baseline date isn't feasible. Real-World Data Integration : When using external data sources (e.g., EHRs, registries), the baseline must be tailored to each subject’s timeline....