---
title: "Regression 3: Homework 1"
author: "Your Name"
date: "6/26/2020"
output: html_document
---

```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
```


This homework is meant to get you working with linear models and to have you evaluate and present multiplicative models. To that end, I have asked you to run a number of models and evaluate various hypotheses. As the assignments are mainly meant as a tool to allow you to better assimilate the information presented in the class, you may present them in whatever method is most useful to you. I would ask, however, if you’re writing math to please use math characters (preferably in an equation environment). From my point of view, it is always easier to read proper tables than statistical output, so that is certainly appreciated– but not an absolute requirement.

The data you will use have been combined from a few sources, specifically for this assignment. In the post-Cold War world, we might be interested in examining competing explanations for U.S. foreign aid allocation. (Note, these are TSCS data, but I don’t want to clutter things up with TSCS problems). These data can be downloaded and saved to your computer from my website [my website](http://www.quantoid.net/teachicpsr/regression3) or load them in directly as below.  This will make an object called `hw1.data` in your workspace.

```{r}
load(file("https://quantoid.net/files/reg3/reg3-hw1-data.rda"))
```


The variables in the dataset are as follows:

- `cown` Numeric COW country code year Year of observation
- `aid_total` Aggregated aid committed by the United States, 2011 constant USD. Countries receiving no aid omitted.
- `country_name` Country Name
- `gdppc` World Bank GDP per capita, constant USD population World Bank total population
- `polity` Combined POLITY score, commonly used as a relative measure of democracy. We will treat this as a continuous measure for now. Higher values correspond to more democratic institutional features, such as constraints on the executive and competition.
- `unsc` United Nations Security Council membership. This is a binary variable, and does not include the permanent members.

A prominent and recurrent theme in the foreign aid literature since at least Morgenthau (1962) is that aid is distributed more in response to strategic concerns of the donor than the economic or political development needs of recipient nations. Your job is to evaluate a few models related to this notion.

1. To start, run a linear model with `aid_total` (logged) as the dependent variable and `gdppc`, `polity`, `population`, and `unsc` as independent variables – all additively related to `aid_total`. How well does the model fit? How important is population relative to the rest of the independent variables? (Make sure to remove -88, -77, and -66 from the polity score!)
2. If the goal of aid from the United States is to promote both economic and political development, then we might expect countries which are both poor and undemocratic to receive larger aid commitment. If aid is used to buy policy then we would expect rich democratic countries to be more expensive to buy off, resulting in larger aid commitments if any aid is received. In either framework, the effect of democracy on aid commitments is thought to depend on the level of economic development (and vice versa). Run a model similar to the one above, but add a multiplicative term between `gdppc` and `polity`. Compare this to the previous model and discuss whether the multiplicative model fits better than the additive model and how you know.
3. Given that both `gdppc` and `polity` are treated as continuous measures, present the results of the second model graphically using any of the tools we spoke about in class. Does the aid-for-development, aid-for-policy, or neither hypothesis find support?
4. In international relations it is common to discretize `polity` into a dichotomous indicator of democracy. Do this by recoding values greater than or equal to 7 as 1 and those less than 7 as 0. Repeat questions 1-3 replacing `polity` with this new indicator (call it `dem_dum`). Does this change the inferences you would make and if so, how? If this were your research, which of these two variables would you use and why?