Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Applied Statistics Expert

R Data Wrangling Homework

Instructions: Download the "Campaign.zip" file from attachment. Unzip to your working directory. And then use the load(file='camp.Rdata') to load a subset of the Contributions from Individuals 2015-2016 file (indiv16.zip) that has been narrowed to include only primary candidates and had a few columns dropped to save space.

Exploring the data

1. What are the ten most popular occupations and their counts in the camp data frame? What are your thoughts about how the data is entered based on the OCCUPATIONS column? Is it selected from a list or inputted as plain text? If you were trying to perform an analysis comparing different sectors donation habits what problems might you run into? Plot the top 6 most common occupations donations distributions. Choose a plot and style that you think easily conveys the information. Comment on anything you find interesting.

2. Join the data with the candidate names (as we did in class) with the appropriate 2015-2016 data. Drop only columns that no longer contain useful information. What are the before and after sizes of each table that goes into and comes out of these combinations? Make sure to drop and document any rows that are missing either a date, candidate, or amount. You may drop other rows if you feel there is a justification, but make sure to document what is dropped and your reason for doing so.

3. Create a data frame "popular" that aggregates the data by candidate and includes columns for the total number of donations made to a candidate and the total amount donated to each candidate.

4. Make tables for both the Republican and Democratic parties that show what the top 10 occupations (by count) that donate to each, the count, how much money in total, and how much on average. Feel free to add any additional information you find interesting to the tables.

5. What are the most common donation sizes? Make a table that for the top 20 donation sizes (by count) includes columns for the number of people that gave that amount, the percent of all donations (by count) that represents, the total amount in dollars, and the percent of all donations (by dollar) that represents. Any comments about the distribution?

6. Create data frames "weekly_d" and "weekly_r" that aggregate the total amount contributed to each candidate each week (with the Democratic candidates being listed in weekly_d and Republican candidates being listed in weekly_r ). For each data frame identify the candidates who received the top 5 most in terms of dollars, aggregate all other candidates in that dataframe into candidate "other". Plot both data frames over the appropriate time scales to compare the cumulative amounts raised over time.

7. Create a data frame "by_state" that aggregates the total number of donations and amount raised by each candidate in each state. Join this to the aggregated primary outcomes of each of the state races. Create columns for both the money raised and the votes received such that each state/party combination sums to 100 (i.e. Clinton might have raised 60% of democratic donations from Kansas and Sanders raised 40%).

8. Read through the state facts list and choose five you think might impact the money raised and the primary outcome. Create (for both money raised and votes won) a decision tree and random forest using your chosen variables. Print the summary() of the models and plot both. What are the results? Does one model do better than the other? What conclusions might you draw from these results? What might be wrong with this model (particularly the votes won)? I'm not asking for a technical answer necessarily, but try and think about the aggregations and scales of the data.

Attachment:- Assignment Files.rar

Applied Statistics, Statistics

  • Category:- Applied Statistics
  • Reference No.:- M92764674
  • Price:- $40

Guranteed 36 Hours Delivery, In Price:- $40

Have any Question?


Related Questions in Applied Statistics

The scientific method assessment task - data analysis

The Scientific Method Assessment Task - Data Analysis Assignment QUESTION 1 - Single-factor experiments Use Minitab for this question. The data in Q1 tab of 60902_AssessmentTask3Data_Spring2018.xlsx records blood cholest ...

Enhancing patient safety through organizational learningare

Enhancing Patient Safety through Organizational Learning: Are Patient Safety Indicators a Step in the Right Direction? by Peter E. Rivard, Amy K. Rosen, and John S. Carroll. Take a professional position, from the HIM per ...

Assignment - research topicpurpose the purpose of this task

Assignment - Research topic Purpose: The purpose of this task is to ensure you are progressing satisfactorily with your research project, and that you have clean, useable data to analyse for your final project report. Ta ...

Assignment -in this assignment ms excel must be used to

Assignment - In this assignment MS Excel must be used to perform any calculations/graphical presentations as required in this assignment. Question 1 - Below you are given the examination scores of 20 students (data set a ...

Exercise -q1 do the example data in table 35-2 meet the

Exercise - Q1. Do the example data in Table 35-2 meet the assumptions for the Pearson χ 2 test? Provide a rationale for your answer. Q2. Compute the χ 2 test. What is the χ 2 value? Q3. Is the χ 2 significant at α = 0.05 ...

Business analytics and statistics research report -this

Business Analytics and Statistics Research Report - This assignment is based on fictional data. You are creating a business report for the CEO of a retail company called, Athlete Panda. It must be professional in present ...

Statistics for business decisions assignment assignment 1

Statistics for Business Decisions Assignment Assignment 1 - QUESTION 1 - Time Series Regression The table below presents the number of students attending Statistics lectures in weeks 1 to 10. Week Number of students 1 90 ...

Using minitab to construct linear regression modelsscatter

Using Minitab to Construct Linear Regression Models Scatter Plot To obtain a simple scatter plot using Minitab: One of the first steps in the analysis of the study data is to create a scatter plot that compares the quant ...

Question onea a factory manager claims that workers at

QUESTION ONE (a) A factory manager claims that workers at plant A are faster than those at plant B. To test the claim, a random sample of times (in minutes) taken to complete a given task was taken from each of the plant ...

Assignment -in this assignment ms excel must be used to

Assignment - In this assignment MS Excel must be used to perform any calculations/graphical presentations as required in this assignment. Question 1 - Below you are given the examination scores of 20 students (data set a ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As