4. The United States Presidential Election Data(1916-1996),Election-Version-0.txt, shows the proportion of votes obtained by a presidential candidate in a United States presidential election, which can be predicted accurately by three macroeconomic variables, incumbency, and a variable which indicates whether the election was held during or just after a war. The variables considered are given as follows
Variable | Definition |
YEAR | Election year |
V | Democratic share of the two-party presidential vote |
I | Indicator variable (1 if there is a Democratic incumbent at the time of the election and 1 if there is a Republican incumbent) |
D | Indicator variable (1 if a Democratic incumbent is running for election, 1 if a Republican incumbent is running for election, and 0 otherwise) |
W | Indicator variable (1 for the elections of 1920, 1944, and 1948, and 0 otherwise) |
G | Growth rate of real per capita GDP in the first three quarters of the election year |
P | Absolute value of the growth rate of the GDP deflator in the first 15 quarters of the administration |
N | Number of quarters in the first 15 quarters of the administration in which the growth rate of real per capita GDP is greater than 3.2% |
All growth rates are annual rates in percentage points.
This dataset Election-Version-0.txt is available in LMS unit STAT2401 on- line. Please download the data, save it in “your working directory”, and read in the data by
setwd("your working directory")
Election = read.table(file="Election-Version-0.txt",header=T)
Consider fitting the initial model
V=0 +1I+2D+3W+4(GI)+5P+6N+✏
to the data.
Report also your R code. [4 marks]