What are the ten most popular occupations in camp data frame

Assignment Help Applied Statistics
Reference no: EM131926015

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

Reference no: EM131926015

Questions Cloud

What would happen if the data were not normalized : What would happen if the data were not normalized? se k-means clustering with the number of clusters that you found above. Does the same picture emerge?
How do you think human communication will evolve : How do you think human communication will evolve in the future? Do you predict an improvement in the ways we communicate with each other?
Should the company buy the proposed piece of equipment : Changing machines in a world without taxes The Clampton Company is considering the purchase of a new machine to perform operations currently being performed.
How the playwrights view marriage expectations of women : You are to write a four (4) to four and a half (4.5) page essay in which you identify and develop a thesis.
What are the ten most popular occupations in camp data frame : R Data Wrangling Homework- Download the "Campaign.zip" file from attachment. What are the ten most popular occupations and their counts in the camp data frame
How should they be used in the cluster analysis : For this goal, you are requested to find a cluster of "healthy cereals." Should the data be normalized? If not, how should they be used in the cluster analysis?
Bogus classification of marijuana : By using phrases like rising tide of common sense, bogus classification of marijuana, and when Uncle Sam gets out of the way
Explain the contents of some or all of the given clusters? : What other external information can explain the contents of some or all of these clusters? Remove all records with missing measurements from the dataset.
What is nashs thesis : What is he trying to convince you is true about people Colonial America and the reasons they might have participated in the American Revolution?

Reviews

len1926015

4/3/2018 4:41:22 AM

Subject: R programming, Comments: Please write the code as code beginner and write down the code step by step with comments. Please read the homework questions carefully and write down the answer. Please use the package that I learned from our lectures which are in the uploaded file. Please let me know if there are any questions. There is google drive share link for Campain. Zip which needs for doing my assignment. Since this zip file is bigger than the limit of the email attachment, so I share the link.

Write a Review

Applied Statistics Questions & Answers

  What would the value of the dow

The Dow Jones Industrial Average was 838.92 on December 31, 1970, and 11,577.51 on December 31, 2010. The CPI was at 39.8 in December 1970 and 219.2 in December 2010. If the Dow had increased by just as much as consumer prices, what would the value..

  The days are between 13 and 14 customers returning items

The days are between 13 and 14 customers returning items

  Chi-square test of independence

A study was done to test the claim that discharging a newborn infant discharged early (less than 30 hours after birth) is related to re-hospitalization of that infant within a week of discharge.

  A company claims the average time a customer waits

A company claims the average time a customer waits on hold is less than 5 min. A sample of 35 customers has an average wait time of 4.78 min. Assume the population standard deviation for wait time is 1.8 min. Test the company claim at the α = 0.05 si..

  Defined as the number of calculators

Rework problem 16 in section 4.1 of your text, involving drawing calculators from a box of working and broken calculators. Assume that the box contains 15 calculators: 13 that work and 2 that do not work. A sample of 5 calculators is selected and a r..

  Write out the probability distribution of x

Write out the probability distribution of x. Find the mean m , variance s2, and standard deviation s of this distribution.

  Is exposure to uv radiation associated with skin cancer

Is exposure to UV radiation associated with skin cancer

  Find the probability that a randomly selected student scores

Scores on a marketing exam are known to be normally distributed with mean and standard deviation of 60 and 20. a) Find the probability that a randomly selected student scores between 50 and 80. b) Find the probability that a randomly selected student..

  How is the rejection region defined

How is the rejection region defined and how is that related to the z-score and the p value? When do you reject or fail to reject the null hypothesis? Why do you think statisticians are asked to complete hypothesis testing? Can you think of examples i..

  Creating a frequency distribution

Individual data values or grouped data when creating a frequency distribution?

  Relationship between sdb and blood pressure values analyzed

What types of tests were used for each of those variables and  was the test used a reasonable selection for each of these test?

  Consider the particle size of a particular product

Consider the particle size of a particular product.

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