程序代写 Homework 1 (Deadline: Jan 16, 2022)

Homework 1 (Deadline: Jan 16, 2022)
1. Suppose we interview five individuals who are registering to vote in the 2016 Presidential election, and learn the following about them in terms of their age (years) and annual income (US$):
• voter 1 is 25 years of age with an income of $24,000; • voter 2 is 37 years with an income of $42,000;
• voter 3 is 45 years of age with an income of $39,000; • voter 4 is 57 years of age with an income of $77,000; • voter 5 is 65 years of age with an income of $84,000.

Copyright By PowCoder代写 加微信 powcoder

Use R to create a data frame consisting of these five individuals and two variables, named Age and Income. Name the data frame election.df. Use the function summary() to find the minimum, maximum, mean, median, and first and third quartiles of two variables.
2. Use the Cars93 data set (included in the MASS package) to answer the following questions:
a. From the structure of the data set: how many observations and how many variables?
b. Provide the frequency and relative frequency distributions (use rbind() to get one table) for the
variable Type. What percentage are large cars?
c. Provide a cross-tabulation table in which the variables Origin and Type are organized along the
two margins.
d. Provide the scatter plot of the two variables: Luggage.room and Weight.
3. R has a number of data sets included. LakeHuron is the name of the data set that contains the “Annual measurements of the level, in feet, of Lake Huron, 1875-1972.” To see more information about the data set, use help(LakeHuron). To see all the available data sets, simply enter data() in the console. Use R to find the 90th percentile, the first, second, and third quantiles, as well as the minimum and maximum values of the LakeHuron data set.
4. Use R to find the range, interquartile range, variance, standard deviation, and plot the boxplot of the LakeHuron data set.

程序代写 CS代考 加微信: powcoder QQ: 1823890830 Email: powcoder@163.com