代写BPE Senior Seminar Fall 2024 Second assignment代写R编程
- 首页 >> C/C++编程BPE Senior Seminar
Fall 2024
Second assignment (100 points)
INSTRUCTIONS: This assignment is due on October 28rd by 11.59 p.m. Please use the following guidelines to complete the assignment and submit our work through NYU Brightspace.
For this assignment, you are required to work in groups of three students. At the beginning of your write- up, clearly state the full names and net IDs of all three members of your group. It's essential that the members of your group remain the same throughout the semester.
You have the option to use either Stata or R software for this assignment. Once you've made your choice, please stick with that software for the entirety of the semester.
Your main write-up should be formatted using the Times New Roman font at a 12pt size with 1.5 spacing. If you're including any code in your assignment, place it at the end in a section titled "Appendix." This section should be formatted using the Courier New font, which is best suited for displaying code in documents.
It's important to note that each member of the group must upload the assignment separately. When you're ready to submit, go to the Assignments tab in BrightSpace. Make sure your document is saved and uploaded as a PDF file. An important detail to remember is to name your file using your network ID. For example, if your net ID is "rcd306", the file you upload should be named "rcd306.pdf". Although your code will not be graded, you are required to submit it. One or two groups will be randomly selected to present their code.
The files to complete this assignment are available on Brightspace and Dropbox.
We strongly recommend that you read the paper first to familiarize yourself with the argument, case, hypothesis, unit of analysis, variables, etc. Read the guidelines for each question carefully.
1. Plotting the initial correlation (25 points)
Download the Excel file tse_replication.xlsx. In a do-file or R-file write down code that can perform. the following tasks. Remember that you need to use the foreign package to open the excel file.
• We are going to replicate Figure 1 from “The Effect of the TseTse Fly on African Development” (Alsan, 2015) (page 387) which uses a scatterplot to visualize the bivariate relationship between suitability for rainfed agriculture (suitability in your dataset) and the Tse Tse suitability index (TSI in your dataset).
To do this, you need to plot the relationship between rain-fed agriculture suitability (dependent variable) and the Tse Tse suitability index (independent variable), and then add the fitted line by running a regression with the same two variables. (10 points)
• What is the value and sign of Beta (β) in the regression of rain-fed agriculture suitability on the Tse Tse suitability index? (5 points)
• Is this value of β the same as the slope of the fitted (regression) line? (5 points)
• Based on what the paper presents, does it make sense to observe this relationship between suitability for rainfed agriculture and the Tse Tse suitability index? Why? Be concise. (5 points)
2. Replicating Table 5 (30 points)
Write down the code that replicates Table 5 (p.402) as closely as possible. Don't worry if the standard errors in parentheses don't exactly match those in the paper, since we haven't learned how to cluster. Also, this may affect the significance of some coefficients, so don't worry if some coefficients are no longer statistically significant as long as they have a similar value and sign to those in the paper.
Note that the names of the different outcomes are placed in the left column, so in this case each model is a different row. For example, the first row shows the regression of large domesticated (animals) on the Tse Tse (TSI) suitability index. This regression also includes the interaction of the Tse Tse (TSI) suitability index with the Africa dummy and the rest of the confounders (meantemp, meanrh, itx, abstlat, lon, malaria_index, coast, river, meanalt, suitability). For each specification, use the previous list of confounders and just change the outcome variable accordingly.
• Replicate the main table (30 points) (Hint: You need to add the interaction of each confounder with the dummy of interest. Use the information in the Stargazer package to edit your table and present it in a nice format. You can flip the table so that each column reflects a different model and not each row as in the paper. It doesn't have to be exactly the same format as the paper, as long as it has the same coefficients.).
3. Interpreting the coefficients (45 points)
• What is beta (β) in column 1 capturing in the last model where centralization is the outcome? (5 points)
• What is sigma (δ) in column 2 capturing in the same model where centralization is the outcome? (10 points)
• What is the coefficient in column 3 (β+δ) capturing in the same model? (10 points)
• What does it mean that beta (β) is mostly insignificant in the different models? Is this problematic for the main argument of the paper? (10 points)
• If someone mentions that the main result is driven by some specific countries in Africa where the TseTse had a large presence. What would be a good way to address that concern? You don't have to do anything in R, just discuss it briefly. (10 points)
4. Extra (25 points)
Plot the coefficients on the interaction term (δ) and the corresponding confidence intervals for each of the different outcomes. This is not in the paper, but you could do this using the last part of the code from the last session.