00:01
Alright, to solve this problem, let's have a step -by -step guide on how to perform the analysis.
00:05
So, starting with step one, we have data preparation.
00:10
We want to load the data.
00:12
So we want to open our dataset files, like files named 1988 .csv and 1986 .csv in your preferred data analysis software, so rstudio or excel.
00:25
And you want to combine the data from both years by matching rows based on the congressional district.
00:31
Next, we want to filter the data.
00:33
We want to only include rows where both democratic and republican candidates received votes in both years.
00:40
And this will ensure that you will only analyze contested elections.
00:45
And we want to calculate vote shares.
00:49
So for 1988, democratic vote share, or dvs, that would just equal democratic votes over democratic votes plus republican votes.
00:59
And for 1986 we have democratic vote share equaling democratic votes over democratic votes plus republican votes.
01:07
Next we can move on to linear regression...