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

  Cross-cultural opportunities and conflicts in canada

Short Paper on Cross-cultural Opportunities and Conflicts in Canada.

  Sociology theory questions

Sociology are very fundamental in nature. Role strain and role constraint speak about the duties and responsibilities of the roles of people in society or in a group. A short theory about Darwin and Moths is also answered.

  A book review on unfaithful angels

This review will help the reader understand the social work profession through different concepts giving the glimpse of why the social work profession might have drifted away from its original purpose of serving the poor.

  Disorder paper: schizophrenia

Schizophrenia does not really have just one single cause. It is a possibility that this disorder could be inherited but not all doctors are sure.

  Individual assignment: two models handout and rubric

Individual Assignment : Two Models Handout and Rubric,    This paper will allow you to understand and evaluate two vastly different organizational models and to effectively communicate their differences.

  Developing strategic intent for toyota

The following report includes the description about the organization, its strategies, industry analysis in which it operates and its position in the industry.

  Gasoline powered passenger vehicles

In this study, we examine how gasoline price volatility and income of the consumers impacts consumer's demand for gasoline.

  An aspect of poverty in canada

Economics thesis undergrad 4th year paper to write. it should be about 22 pages in length, literature review, economic analysis and then data or cost benefit analysis.

  Ngn customer satisfaction qos indicator for 3g services

The paper aims to highlight the global trends in countries and regions where 3G has already been introduced and propose an implementation plan to the telecom operators of developing countries.

  Prepare a power point presentation

Prepare the power point presentation for the case: Santa Fe Independent School District

  Information literacy is important in this environment

Information literacy is critically important in this contemporary environment

  Associative property of multiplication

Write a definition for associative property of multiplication.

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