# Motivation

Randomized experiment is the gold standard to examine causality. However, it’s often the case that we cannot conduct experiments for a variety of practical reasons and have to rely on observational data. Matching is a method used to approximate experimental results to recover the causal effect from observational data.

When…

# Apply Propensity Score Methods in Causal Inference — Part 1: Stratification

## With an Example Implemented Step by Step in Python

This article introduces and implements the framework of propensity score method from Dehejia and Wahba (1999) “Causal Effects in Non-Experimental Studies: Reevaluating the Evaluation of Training Programs,” Journal of the American Statistical Association, Vol. 94, №448 (December 1999), pp. 1053–1062. I will briefly go over the theories and then walk…

# Analyze Causal Effect Using Diff-in-Diff Model

## With a real-world application

It is not always feasible to do randomized AB experiments, but we can still recover the causal effect of a treatment if we have a near-experiment that generates observational data over time (i.e. panel data). …

# Motivation

The Nobel Prize in Economic Sciences 2021 is awarded to Joshua D. Angrist and Guido W. Imbens “for their methodological contributions to the analysis of causal relationships.”. If you wonder what “ the methodological contributions” are in specific and are willing to dig deeper into the scientific background, you will…

# Apply Propensity Score Method in Causal Inference — Part 2: K-Nearest Neighbor Matching

## with a Real-World Example in Python

In my last article, I introduced how to estimate propensity score using logistic regression model and do stratification matching step by step. To recap, in practice, the propensity score method is usually done in two steps. First, we estimate the propensity score. …

# Testing the Assumptions of Linear Regression

## Build a linear regression model step by step to test the Gauss-Markov assumptions

It seems that nowadays when everyone is so much into all kinds of fancy machine learning algorithms, few people still care to ask: what are the key assumptions required for the Ordinary Least Squares (OLS) regression? How can I test if my model satisfies these assumptions? However, as simple linear…

# An Illustration of Survey Sampling and Weighting

Survey is widely used in social science, public opinion polling, and marketing research. I use survey when the data I need to answer my questions can not be found in any existing data tables or be scraped from some webpages, so I have to go ask for the data myself…

# Analyze the Effect of Randomized Experiment using the Tennessee STAR Experiment

## Analyze the causal effect of class size using linear regression in Python

Randomized experiment or randomized control trial (RCT) is regarded as the gold standard to test causality. In the tech industry, RCT takes the form of online platform experiments and is often called A/B testing.

In this article, I will walk through the potential outcome model underlying the inference of the…

# Randomized Experiment and Potential Outcome Model

## Dive deep into the importance of randomization

Randomized experiment or randomized control trial (RCT) is regarded as the gold standard to test causality in medicine, science, and social science. In the tech industry, RCT takes the form of an online platform experiment and is often called A/B testing.

An RCT takes a group of subjects and randomly…

# Use Input-Output Model to Assess Economic Impact

## How to perform an economic impact analysis step by step

In this article, I will introduce the Input-Output model framework, explain the structure of an input-output table, and walk through step-by-step how to perform an economic impact analysis.

# Introduction

The Input-Output model is a framework developed by Dr. Leontief, in recognition of which he received the Nobel Prize in Economic Science…

## Shuangyuan (Sharon) Wei

data scientist, rock climber

Get the Medium app