程序代写案例-POLI 7000-Assignment 3

欢迎使用51辅导,51作业君孵化低价透明的学长辅导平台,服务保持优质,平均费用压低50%以上! 51fudao.top
POLI 7000 Writing Assignment 3
Soren Jordan
Spring 2021
This will be due April 9 (Friday) by 11:59 PM to Canvas as a .pdf. You lose 10 points for
each day it is late. A complete assignment consists of three parts:
1. First, the actual written document (white paper). You must produce the required
document in a professional way. The required document is outlined in the section
“Written Assignment.”
2. Second, the general questions and R script. You will be asked a series of questions
about the statistics behind the written document (white paper). These questions are
outlined in the section “R Instructions and Questions.”
(a) Answer these as comments in your R script.
(b) Then, to demonstrate your proficiency with the software, you must turn in the
code you executed to obtain the results you use to construct the written document
(memorandum).
3. Third, once all of the questions are answered, please run your R script to execute it in
the R console. Copy and paste the R console at the end.
Thus, when turning in the assignment, you should have the written document (white paper)
first. Then, you should start a new page and paste the script, followed by the console, and
save the whole thing as a .pdf. This is still a writing assignment. That means your sentences
should be free of spelling and grammatical errors and should use complete sentences. You
should also follow the guidelines for creating attractive documents, as outlined separately on
Canvas.
Recall: you are allowed to consult with one another on coding for homework assignments, as
long as
1. You never “divide and conquer” the assignment. All students are responsible for all
portions of each assignment, and
2. You are not allowed to collaborate on the “applied” or “discussion” portions of ques-
tions. You can code together, but as soon as you start writing sentences, you must use
your own words and your own words alone, and
3. You explain your answers. Even if an answer is a simple mathematical solution, explain
how you arrived at it. I can’t give partial credit for wrong numbers, but I can give
partial credit for a thought process.
If you have questions . . .
• Overall, please feel free to post to the relevant Discussion page on Canvas.
• About R, please feel free to email me directly.
• About style, please free to email Noemi ([email protected]), our TA.
Finally, you’ll notice that the point total below is 160. The assignment is worth 150 points.
To be clear: any points you earn above 150, you still get (so it’s like having a 10-point
“bonus”). Since your final semester grade is just the total number of points you earn across
all assignments, this is like having a 10-point bonus on any assignment.
The assignment starts on the next page.
R Instructions and Questions
Reminder: to download data and read it into R
1. Download the dataset (usually XXX.csv) from Canvas
2. Move it to wherever all of your course materials are on your computer
3. Once it is on your computer, copy the filepath and read it into R
• On a Mac, you can use option + command + c to copy a file path
• On Windows, hold down shift and right-click to Copy as path. See
tinyurl.com/windows-file-path. Also, on Windows you must reverse the di-
rection of the slashes in the filepath
• As a reminder, there are scripts on Canvas to use as a helpful example
Read Thomsen and Sanders, “Gender Differences in Legislator Responsiveness.” (Note: you
will be replicating Table 1, Models 1 and 2!)
Download the data from Canvas: thomsen.csv.1 It contains eight variables:
• X: A counter variable for each row
• any_reply: An indicator (dummy) variable for if the legislator sent any reply
– 0 = No
– 1 = Yes
• info_reply: An indicator (dummy) variable for if the legislator sent a helpful reply
– 0 = No
– 1 = Yes
• female: An indicator (dummy) variable for if the legislator is female
– 0 = No
– 1 = Yes
• republican: An indicator (dummy) variable for if the legislator is Republican
– 0 = No
– 1 = Yes
• senate: An indicator (dummy) variable for if the legislator is in the state Senate
– 0 = No
– 1 = Yes
• party_leader: An indicator (dummy) variable for if the legislator is a party leader
1This is the actual dataset used to write the article we read.
– 0 = No
– 1 = Yes
• comm_chair: An indicator (dummy) variable for if the legislator is a committee chair
– 0 = No
– 1 = Yes
• years_served: How many years the legislator has served
– (Number of years)
• minority_party: An indicator (dummy) variable for if the legislator is in the minority
party (doesn’t control the chamber)
– 0 = No
– 1 = Yes
• prev_vote_share: The vote share for the legislator in the previous election
– (Vote share in numeric)
• up_for_reelection: An indicator (dummy) variable for if the legislator is up for
reelection
– 0 = No
– 1 = Yes
• dist_conservatism: The ideological conservatism of the district (higher numbers are
more conservative)
– (Ideology from liberal [low] to conservative [high])
• dist_pop: The population of the district
– (Number of population)
• dist_income: The average income of the district
– (Income in dollars)
• state: An indicator variable for the state of the legislator
– (Numeric indicator for the state, 1-50. Notice these are read as numbers, but the
numbers have no order. They just indicate the state)
• state_X: A series of indicator (dummy) variables for the state of the legislator. For
each (like state_1), it is a dummy variable for if the legislator is from that state
– 0 = No
– 1 = Yes
Use the following instructions. If you see (XX points) beside a question, this means that
this is an additional question you must answer in the R script for the assignment.
1. Estimate the regression of any_reply (Y ) on female, republican, senate, party_leader,
comm_chair, years_served, minority_party, prev_vote_share, up_for_reelection,
dist_conservatism, dist_pop, dist_income, and all of the state_ dummy variables
(state_2 through state_49, notice that there is no state_40).
(a) (2 points): Why are the βˆ estimates for dist_pop and dist_income so small?
(b) (4 points): Interpret the βˆ for dist_pop and dist_income.
(c) (3 points): Which of these βˆ can you compare directly to each other? Why?
2. To ease interpretation, create two new variables: dist_pop_100000 (population in
100,000 units increments, so 1 = 100,000 people) and dist_income_10000 (income in
$10,000 units increments, so 1 = $10,000 people).
3. (16 points [4 points each]): Using ggplot, create four plots.
(a) The first two are barplots of the frequency of any_reply_fac (the first) and
info_reply (the second), both filled by whether the legislator is female and
faceted by if the legislator is republican.
(b) The second two are point (scatter) plots of dist_conservatism and dist_pop,
with the points colored by if the legislator is female, and the plot characters
changed by if the legislator replied (any_reply) (the third) or replied helpfully
(info_reply) (the fourth). Your plots should exactly match the ones shown
below.
(c) To consider: last time you made plots, you sometimes made factor versions of
numeric variables so that ggplot understood them as categories better.
(d) Also to consider: you can save plots from R directly by using the pdf() function.
You call pdf(), then make the plot, then run dev.off() to close the connection.
Example:
pdf("filepath.pdf")
ggplot(...)
dev.off()
Democrat Republican
No Yes No Yes
0
500
1000
1500
2000
Any Reply Received
Co
un
t Gender
Male
Female
Figure 1: First plot.
Democrat Republican
No Yes No Yes
0
500
1000
1500
2000
Any Reply Received
Co
un
t Gender
Male
Female
Figure 2: Second plot.
0250000
500000
750000
1000000
1250000
−1.0 −0.5 0.0 0.5 1.0
District Conservatism
D
is
tri
ct
P
o
pu
la
tio
n
Gender
Male
Female
Any Reply
No
Yes
Figure 3: Third plot.
0
250000
500000
750000
1000000
1250000
−1.0 −0.5 0.0 0.5 1.0
District Conservatism
D
is
tri
ct
P
o
pu
la
tio
n
Gender
Male
Female
Helpful Reply
No
Yes
Figure 4: Fourth plot.
4. Estimate the regression of any_reply (Y ) on female, republican, senate, party_leader,
comm_chair, years_served, minority_party, prev_vote_share, up_for_reelection,
dist_conservatism, dist_pop_100000, dist_income_10000, and all of the state_
dummy variables (state_2 through state_49, notice that there is no state_40).
(a) (2 points): Interpret the αˆ from this regression. Is it substantively useful?
(b) (2 points): Interpret the RMSE from this regression.
(c) (2 points): Interpret the R2 from this regression.
(d) (3 points): Which βˆ are statistically significant? What does this allow us to
conclude about the relationship between those X variables and Y ?
(e) (4 points): Interpret the βˆ on female. What does a “one-unit increase” mean
here? Is that the biggest effect this variable can have?
(f) (4 points): Interpret the βˆ on dist_pop_1000000. What is the maximum effect
population can have, given the range of populations in the sample? Is this effect
substantively significant? Why or why not?
(g) (4 points): Interpret the βˆ on dist_conservatism. What is the effect of moving
from the first quartile to third quartile of dist_conservatism? What does this
movement mean substantively, in plain English?
(h) (4 points): Interpret the βˆ on dist_income_10000. What is the effect of a $20,000
increase indist_income_10000?
(i) (4 points): Interpret the βˆ on years_served. What is the effect of a standard-
deviation increase inyears_served?
5. Estimate the regression of info_reply (Y ) on female, republican, senate, party_leader,
comm_chair, years_served, minority_party, prev_vote_share, up_for_reelection,
dist_conservatism, dist_pop_100000, dist_income_10000, and all of the state_
dummy variables (state_2 through state_49, notice that there is no state_40).
(a) (2 points): Interpret the αˆ from this regression. Is it substantively useful?
(b) (2 points): Interpret the RMSE from this regression.
(c) (2 points): Interpret the R2 from this regression.
(d) (3 points): Which βˆ are statistically significant? What does this allow us to
conclude about the relationship between those X variables and Y ?
(e) (3 points): Do these predictors better explain if we receive any reply or a helpful
reply?
(f) (4 points): Which is more substantively significant, female or comm_chair? Jus-
tify your answer.
(g) (4 points): Which is more substantively significant, female or party_leader?
Justify your answer.
(h) (4 points): Which is more substantively significant, female or years_served?
Justify your answer.
6. (16 points [2 points each]): Predict the likelihood of any_reply and info_reply, for
a Democrat male (female = 0 and republican = 0), a Democrat female (female =
1 and republican = 0), a Republican male (female = 0 and republican = 1), and
a Republican female (female = 1 and republican = 1), holding the other variables
constant at someone who is in the state Senate, who is not a party leader, who is not
a committee chair, with average (mean) years of service, who is not in the minority
party, with average previous vote share, who is not up for reelection, with average
district conservatism, with average district population, with average district income,
and who is from state_2 (and thus not from any other state). Note: this means you
will generate eight total predictions.
7. (4 points): Why does it not makes sense to just hold all of the variables at their means?
Written Assignment
You are an employee at a nonpartisan, nonprofit organization whose mission is to encourage
and train women run for elected office. The executive director of your organization comes
across a dataset that measures a legislator’s responsiveness to his or her constituency. The
executive director asks you to perform statistical analysis on the dataset and identify the
relationship between female legislators and responsiveness. (5 points: you should invent the
organization and create a logo for the first page of the document.)
You must write a white paper. On Canvas, there are many, many examples of white papers.
Specifically for the assignment, your white paper must disseminate your findings and make
recommendations for how the findings should be incorporated into future training programs.
Although this is an internal document for your executive director and training staff, keep
in mind that it may also be shared on the organization’s website. Your white paper should
include the following sections and the following information within each section.
Note: this is also meant to practice using analysis to communicate with non-analysts. As
you discuss your models, you should do so in plain English. Specifically:
• Avoid phrases like “effect of X on Y ,” instead focusing on the actual variables.
• Where possible, replace the discussion of “units” of variables with the actual unit (for
instance, if the variable is age, talk about a one-year increase in age, not a one-unit
increase in age).
• Use consistent, non-obnoxious rounding (like to the tenths place).
• At no point should your document include R code.
• Cite any research in a footnote.
• In all other places, follow the white paper style guide on Canvas.
Executive Summary (10 points)
• In less than a page:
– Summarize the original study that the authors conducted, including any experi-
mental manipulations.
– Summarize the data, including explaining the unit of analysis (what a row in the
dataset represents).
– Summarize how the data were analyzed.
– Summarize the findings.
– Argue for the importance of the findings.
Background (6 points)
• In less than a half page:
– Using the literature review of Thomsen and Sanders (2020) as a guide, provide
a brief background regarding the relationship between legislators and responsive-
ness.
– Bring in any outside sources as you see fit.
Literature Review (6 points)
• In less than a half page:
– Using the literature review of Thomsen and Sanders (2020) as a guide, provide a
brief background regarding why the relationship between legislators and respon-
siveness should be dependent on whether the legislator is male or female.
– Bring in any outside sources as you see fit.
Data and Methods (8 points)
• In less than a page:
– Identify all of the variables that were collected.
– Identify the measurement of the key independent variable (gender).
– Identify the measurement of the two dependent variables (any response and helpful
response).
– Explain what the regressions that you run are doing to summarize the relationship.
– At the end of the section, identify how the analysis you perform allows you to
add to the discussion you outlined in the Literature Review section.
Findings (15 points)
• In one or two pages:
– Show your four plots. Interpret each.
– What did your regressions find about the determinants of receiving replies and
helpful replies?
– Be sure to fully interpret the effect of being female.
– Interpret the statistical and substantive significance of being Republican, being a
party leader, and district conservatism in each regression.
– In a footnote: explain what each regression “controls” for. Mention the two
measures of fit for each regression.
– Show and interpret your four predictions.
Proposed Solutions and Recommendations (6 points)
• In one page:
– Explain what actions your nonprofit should take, based on the data you analyzed.
– How should the women taking part in the training program incorporate this in-
formation into their campaigns?
– Keep in mind that although this is an internal document, it may be shared exter-
nally and used to persuade voters.
Conclusion (6 points)
• In less than half a page:
– Connect the findings back to the purpose and mission of your organization.
– Explain how these findings reflect on politics and future directions in politics.
Remember, you must follow the rules for Document Design Best Practices (available on
Canvas). The white paper has a maximum length of eight pages.

欢迎咨询51作业君
51作业君

Email:51zuoyejun

@gmail.com

添加客服微信: abby12468