********* please I need codes to run (( R language)) we will perform a Regression Discontinuity analysis...
Question:
********* please I need codes to run (( R language))
we will perform a Regression Discontinuity analysis by taking observations that are close to *any* of the cutoffs. In this question, we will be comparing rates of corruption for villages just above and below a series of population thresholds for different federal transfer amounts. Recall from the article that the amount of federal transfers to municipalities should change (discontinuously) at several population cut points (see Table 1 of the article).
To begin, subset of the data that contains observations within 500 people of the population cuttoffs: $\{10188, 13584, 16980, 23772, 30564, 37356, 44148\}$. We want to include all municipalities that have populations within 500 people above or below any of these cutoffs (the R 'OR' operator, `|`, may be useful here). Next, using that subset for municipalities within the 500 +/- range of the cutoffs, create an indicator variable to show whether each remaining observation is above or below the nearest cutoff point. For example, a municipality with a population of 10,180 would be "0", a 10,200 would "1", a 13,500 would be "0", and a 13,600 would be "1" and so on.
You should now have a subset of data with the columns for "broad", "narrow" and the 0/1 indicator variable, where the a "1" indicates the population is just above the nearest cut off point and a "0" indicates the population is just below the nearest cut off point. Now, use `lm()` to compare the rates of broad and narrow corruption for municipalities just above and just below these thresholds. Explain your interpretation of the coefficient for the indicator variable. Does this evidence support the "political resource curse" hypothesis? Finally, earlier in question 1, you performed a simple analysis that regressed measures of corruption on federal transfers. Between what you did in question 1 and what you just did in question 5, is one of the results more convincing? If so, which one?