Skip to content
DeepForgeby svx
All problems
MediumStatisticsst-301

Event Study Pre-Trend Slope

Problem

Return the OLS slope of the event-study coefficients on event time for the pre-period leads, a placebo check for differential pre-trends. Return 0.0 when there are fewer than two points or event times do not vary.

Hint

A flat pre-trend is evidence for parallel trends.

Test cases

case 1
in: [[-3,-2,-1],[0.3,0.2,0.1]]
expected: -0.09999999999999999
case 2
in: [[-4,-3,-2],[1,0.5,0]]
expected: -0.5
case 3
in: [[1],[0.5]]
expected: 0
case 4
in: [[-2,-1],[0.2,0.4]]
expected: 0.2
case 5
in: [[0,1,2],[1,1,1]]
expected: 0
Starter codePython
def event_study_slope(periods, coefficients):
    # Your code here
    pass

5 test cases · run your code against them in the editor