In this exercise, we examine a hypothesis that individuals who lost
someone in the terrorist attacks of 9/11, whether a family relative or
a neighbor, will have become more politically engaged.

This exercise is based on: Hersh, E. D. 2013. “[Long-Term Effect of September 11 on the Political Behavior of Victims’ Families and Neighbors.](http://dx.doi.org/10.1073/pnas.1315043110)” *Proceedings of the National Academy of Sciences* 110(52): 20959–63. 

We will examine this hypothesis
using several different estimation techniques, focusing throughout on
the effect of the attacks on the victims' families rather than their
neighbors. The CSV data file, `victims9-11.csv`, contains the
following variables:

------------------------------------------------------------------------------
 Name                Description
 ------------------- ---------------------------------------------------------
 `voter.id`          Unique identifiers of relatives and neighbors of the 
                     victims 
                     
 `treatment`         Families and neighbors of actual victims (1) vs control 
                     group (0)
 
 `victim.status`     Families (2) vs neighbors (3) of victims and controls
 
 `ge20xx`            Voting in the `20xx` general election (`Y`=at the polls, 
                     `A`=absentee, `E`=early, `M`=by mail) 
 
 `fam.members`       Number of family members living with voter at their address 
 
 `age`               Voter's age 
 
 `party`             Voter's party affiliation (`D`=Democrat, `R`=Republicans, 
                     `N`=no affiliation) 
 
 `sex`               Voter's sex
 
 `pct.white`         Proportion of non-Hispanic white voters living on the same 
                     block 
 
 `median.income`     Median income of voters living on the same block  
------------------------------------------------------------------------------

Voters were
included in the data on the basis of their relationship to actual
victims - these constitute the two treatment groups - or if no
such relationship existed but they were, otherwise, sufficiently
similar to voters in the treatment groups - this constitutes the
control group. 

## Question 1

We begin by reformatting the data to facilitate our analysis.
The three variables that contain non-numerical values are sex,
party, and voting records. Rewrite these variables using the
following coding rules: for the party variable, assign the value of
$1$ to all Democrats, $-1$ to all Republicans, and $0$ for all other
parties and non-affiliated citizens; for the sex variable, assign
the value of $1$ to all female citizens and $0$ to all male
citizens; finally, for each of the seven voting record variables,
assign the value of $1$ if the individual voted in a given election,
and $0$ otherwise.

## Answer 1
```{r}
victims <- read.csv("data/911-victims.csv")


```

## Question 2

We will now test the hypothesis. Calculate the sample Average
Treatment Effect of the terrorist attacks on voter turnout
separately for each of the seven general elections between 2000 and
2012. Focus on families of victims as the treatment, and disregard
the neighbor category. For each of the seven point-estimates,
compute the corresponding standard error.  Assume that both the
treatment and control groups form two random samples, and that the
two samples are statistically independent. Then, using the quantiles
of the standard normal distribution, calculate the 95% confidence
intervals for each of the seven point-estimates. Plot the results
where the horizontal axis represents the elections.  Provide a brief
interpretation, with a particular focus on the meaning of the
confidence intervals you computed.

## Answer 2

```{r}
 
```
 

## Question 3

To examine the validity of the cross-sectional comparisons
conducted in Question 2, check whether possible confounders are
balanced between the treatment and control groups. Compare the means
of the last six variables in the table above across the two
groups along with their 95\% confidence intervals.  Provide a brief
interpretation of the results. What can you conclude about the
validity of the cross-sectional comparisons?

## Answer 3

```{r}
 
```

 
## Question 4

Now, focus on the treatment group only. Compute the
before-and-after estimate of the effect of the terrorist attacks on
voter turnout for families of the victims by using the 2000 general
election as a baseline for each of the subsequent six general
elections. Next, calculate the standard errors corresponding to the
six point-estimates.  Using the standard errors, compute the 95%
confidence intervals for each of the six point-estimates.  Plot the
results. Provide a brief interpretation of your
findings. **Hint**: Since you are now tracing the
same sample evolve through time, you can no longer assume the
independence of sample means in calculating the standard errors;
take care to incorporate the covariance between voter turnout in 2000
and a subsequent election into your calculations.

## Answer 4
```{r}
 
```

 
## Question 5

We will now repeat the same analysis as in Question 4, but now
using voters in the control group only. As before, be sure to
restrict your analysis to family relatives of control victims rather
than their neighbors.  What does this analysis imply about the
validity of the analysis in the previous question?

## Answer 5

```{r}
 
```

 
## Question 6

Calculate the difference-in-differences estimate for the general
elections immediately surrounding the attacks, 2000 and
2002. Calculate the standard error for your estimate, and provide
the 95% confidence interval.  Once again, you are allowed to use
the quantiles of the standard normal distribution in calculating the
confidence interval.  Provide a brief interpretation of the result.

## Answer 6

```{r}
 
```

## Question 7

Repeat the previous difference-in-differences analysis for all
six elections following the attacks.  Throughout this analysis,
use the 2000 election as the baseline as done in the previous
question.  Plot the results with the horizontal axis representing
different elections.  Provide a substantive interpretation of the
results.

## Answer 7
```{r}
 
```

 