程序代写代做 graph Case 01: Nathan’s Hot Dog Eating Contest

Case 01: Nathan’s Hot Dog Eating Contest
The Nathan’s Hot Dog Eating Contest is an annual American competitive eating competition, which is run as a publicity gathering event by Shea Communications. It is held each year on July 4 at Nathan’s Famous Corporation’s original in a neighborhood of Brooklyn, New York.
The contest has gained public attention in recent years due to the sudden stardom of Takeru Kobayashi, and later his rival American Joey Chestnut. There are 5 variables in the data set:
• Year
• Winner: winner’s name
• Dogs.eaten: the number of hot dogs and buns eaten
• Country: the winner’s resident country
• New.record: It will be 1 if the world record was broken on a year, otherwise 0.
a. Create the following graph that shows the number of hot dogs eaten over the years. The bars are ‘lightblue’, except when the record was broken, then the bars are ‘red’.
Number of Hot Dogs Eaten
60
40
20
0
1980 1990
2000 2010
2
Year

Case 02: General Social Survey (GSS)
Since 1972, the General Social Survey (GSS) has been monitoring societal change and studying the growing complexity of American society. GSS is a long-running US survey conducted by the independent research organization NORC at the University of Chicago.
In order to answer the following questions, please use the dataset ‘gss.csv’. There are 9 variables in the dataset.
a. Create a data frame that shows the name and count of the party affiliations. This data frame should only include those whose count is greater than or equal to 2000.
b. Using the data frame that you created in part (a), create a bar chart that shows the percentage of each of the party affiliations. (bar colors for independent “purple”, for democrats “lightblue”, and for republicans “red”)
0.20
0.15
0.10
0.05
0.00
Independent Not str democrat Strong democratNot str republican Ind,near dem Strong republican
c. Create a density plot that shows the age distribution of “White” and “Black” Americans as follows. Make sure to exclude all missing values in “age”. (Note: Colors used are the default ggplot colors, with alpha = 0.4)
3
Percent (%)

0.020
0.015
0.010 White
0.005
0.000
20 40 60 80
Age
d.
Create a copy of the following bar chart, to show the distribution of older generation (>=50) vs. younger generation (<50) among different party affiliations. (Note that the colors used are lightblue for older and ‘pink’ for younger. 4 race Black density Number of People: Party Aff. vs. Age (<50: Blue, >=50: Pink)
Strong republican Strong democrat Other party Not str republican Not str democrat No answer Independent Ind,near rep Ind,near dem Don’t know
e.
0 1000 2000
Explore the average number of hours spent watching TV per day across religions, by creating the following graph.
Don’t know Native american Protestant Catholic Inter−nondenominational Christian Other No answer None Jewish Moslem/islam Orthodox−christian Buddhism Hinduism Other eastern
234
Avg. TV Hours
5
Religion