Create a scatterplot showing support for clinton vs trump

Assignment Help Other Subject
Reference no: EM132389475

Assignment

This assignment is about how the U.S. president is elected by the electoral college -- 538 electors corresponding to 435 members of congress, 100 senators, and 3 additional electors allocated to Washington D.C.. The number of electoral votes allocated to each state is equal to the size of its congressional delegation. And most states cast all their electoral votes for the candidate receiving a plurality of the state's votes in the general election (the *winner-takes-all* rule).

Nebraska and Maine are the only two exceptions. These states allocate two electoral votes to the candidate receiving a plurality of the state's votes, and each of their remaining electoral votes go to the candidate receiving a plurality of votes within each of the states' congressional districts. But these are small and relatively homogeneous states. Maine has never actually split its electoral votes and Nebraska did it only once, casting a vote for Obama in 2008.

A candidate must receive a simple majority of electoral college votes (270 votes) to be elected. But, as in 2000, it is possible for a candidate to win the election without receiving a plurality of the popular vote. Analyze state-level polls downloaded from the Huffington Post's Pollster and 3 additional polls for Washington D.C. available to predict the outcomes of the 2016 presidential election. Predict the distribution of electoral college votes according to the *winner-takes-all* rule and using only the 3 most recent polls in each state and examine how this distribution changed over time, starting at 90 days before the election.

The dataset (`polls2016.csv`) has 905 observations, each representing a different poll, and includes the following 7 variables:
-----------------------------------------------------------------------------
Name Description
--------------- ---------------------------------------------------------
`id` Poll ID

`state` U.S. state where poll was fielded

`Clinton` The poll's estimated level of support for Hillary Clinton(in percentage points)

`Trump` The poll's estimated level of support for Donald Trump (in percentage points)

`days_to_election` Number of days before November 4, 2016.

`electoral_votes` Number of electoral votes allocated to the state where the poll was fielded (a state-level variable)

`population` The poll's target population, which may be `Adults`, `Registered Voters`, or `Likely Voters`

--------------------------------------------------------------------------------
Question 1

Begin by restricting poll data to the 3 most recent polls in each state and computing the average support for each candidate by state. Create a scatterplot showing support for Clinton vs. support for Trump. Use state abbreviations to plot the results. Briefly interpret the results.

To do this sort the polls by the `days_to_election` variable within each state. Use the `sort()` function to sort the polls from the latest to the oldest. When the `index.return` argument is set to `TRUE`, this function will return the ordering index vector, which can be used to extract the 3 most recent polls for each state. Calculate the predicted margin between the candidates, because the question asks to plot the average support for each.

Question 2

Based on the average support calculated for Clinton and Trump, predict the winner of each state and allocate the corresponding electoral college votes to the predicted winner. While two states, Maine and Nebraska, do not apply the *winner-takes-all* rule to allocate their electoral votes, for the sake of simplicity, apply this rule uniformly across these states as well. If the support for the two candidates in a given state is identical, split the state's electoral votes. Who would be predicted to win the election based on these polls? How many electoral college votes would be predicted for each candidate to receive? Use a loop and conditional statements (`if ... else if ... else`).

Attachment:- Polls Data 2016.rar

Reference no: EM132389475

Questions Cloud

What is meant by most favored nation status : What is meant by "most favored nation" status? Was the American version of the Auto Pact consistent with MFN?
Driving forces behind health care expenditure increase : What factors are driving forces behind health care expenditure increase over the last few decades?
What are the three types of unemployment : What are the three types of unemployment? Which of these are counted towards the actual unemployment figure, and do you think this is a good measure?
Describe the different types of operating systems : Topic: Computerized Operating Systems (OS) are almost everywhere. We encounter them when we use out laptop or desktop computer. We use them when we use.
Create a scatterplot showing support for clinton vs trump : Create a scatterplot showing support for Clinton vs. support for Trump. Use state abbreviations to plot the results. Briefly interpret the results.
MITS4003 Database Systems Assignment Problem : MITS4003 Database Systems assignment help and solutions, Victorian Institute of Technology, assessment help - Presentation on academic paper on Database System.
Absolute advantage and comparative advantage : 1. What is the difference between absolute advantage and comparative advantage?
Disadvantages of government money borrowing : What are the advantages and disadvantages of government money borrowing?
Explain the true cost to society associated : Explain the "true cost" to society associated with monopolies

Reviews

Write a Review

Other Subject Questions & Answers

  Discuss the factors that may lead to cumulative effects in

1.compare and contrast the purpose and action of nonopiod opiod and adjuvant analgesics sedatives and hypnotics.2.why

  Conduct a root cause analysis

Post a description of the problem and a summary of your root cause analysis, including recommendations for proposed action

  Specific types of transporters found in cell membranes

A list of specific types of transporters found in cell membranes. how the transporter works. whether it is an active or passive transporter

  Discuss hendersons needs theory

The nursing theory I have chosen is Henderson's needs theory. The nursing problem I have selected is patient

  What did you take away from the experience

What was your experience, what did you do? (e.g. work in the garden, base building, alley assessment)What did you take away from the experience.

  State the null hypothesis that the size of the student body

Are rent rates influenced by the student population in a college town? Let rent be the average monthly rent paid on rental units in a college town in the United States. Let pop denote the total city population

  Discuss current issue in the field of life-span development

Select a current issue in the field of Life-Span Development, then submit a proposal for your final analysis paper

  What are your thoughts about research in general

Research is the foundation of this program and a key element of the roles and responsibilities of a scholar-practitioner. Discuss the following.

  What you found interesting confusing and contradictory

Discuss what you found interesting, confusing, relevant, or contradictory about the economic development program.

  Peter joseph haylen vs nsw rugby union ltd 2002

Peter Joseph haylen vs nsw rugby union Ltd 2002 - I need only PPT slides for presentation. No need of document .

  Discuss the impact on the woman who resisted

Impact on the Woman who Resisted/Impact on Her Community: discuss the impact on the woman who resisted, impact on her community, etc.

  Discuss about the ethics in policing administration

Locate 2 peer-reviewed articles no older than 5 years about ethics in policing administration. Provide an in-depth discussion of the findings in each article.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd