Quasi Experiment, Experimentation, Synthetic Control, Causal Inference, Data Science.
variable data['time'] = np.arange(len(data)) data['intervention'] = data['time'] >= intervention_time # Fit a linear regression model with the outcome, time, and intervention indicator X = data[['time', 'intervention']] X = sm.add_constant(X) y = data['outcome'] model = sm.OLS(y, X).fit() # Print