1. mpg: Miles/(US) gallon 2. cyl: Number of cylinders 3. disp: Displacement (cu.in.) 4. hp: Gross horsepower 5. drat: Rear axle ratio 6. wt: Weight (1000 lbs) 7. qsec: 1/4 mile time 8. Vs: V/S 9. am: Transmission (0 = automatic, 1 = manual) 10. gear: Number of forward gears 11. carb: Number of carburetors Use R and its built-in data set mtcars to complete the following. (a) Explore the structure of the data set. Notice that the variable Transmission is stored as numeric, but the description says it is a binary variable (categorical). Change the variable Transmission into a factor (categorical variable). Make sure you name the levels of this categorical variable (follow the order in the description). Now check the structure of your data set and notice the change you made to Transmission. (b) Create and store two variables as vectors: mpg for automatic vehicles and mpg for manual vehicles. (e) Find the sample mean, median, variance and standard deviation for each variable from part (b). (d) Create a boxplot(s) comparing both variables from part (b). Both boxplots should be in the same image and make sure to include the appropriate labels and title. Discuss the following (refer to the boxplots when applicable): (i) Compare the sample median to the sample mean for each variable. (ii) Compare the sample medians of the two variables. (iii) Compare the variability of the two variables.

A First Course in Probability (10th Edition)
10th Edition
ISBN:9780134753119
Author:Sheldon Ross
Publisher:Sheldon Ross
Chapter1: Combinatorial Analysis
Section: Chapter Questions
Problem 1.1P: a. How many different 7-place license plates are possible if the first 2 places are for letters and...
icon
Related questions
Question
1. mpg: Miles/(US) gallon
2. cyl: Number of cylinders
3. disp: Displacement (cu.in.)
4. hp: Gross horsepower
5. drat: Rear axle ratio
6. wt: Weight (1000 lbs)
7. qsec: 1/4 mile time
8. Vs: V/S
9. am: Transmission (0 = automatic, 1 = manual)
10. gear: Number of forward gears
11. carb: Number of carburetors
Use R. and its built-in data set mtcars to complete the following.
(a) Explore the structure of the data set. Notice that the variable Transmission is stored as numeric, but the description
says it is a binary variable (categorical). Change the variable Transmission into a factor (categorical variable). Make
sure you name the levels of this categorical variable (follow the order in the description). Now check the structure of
your data set and notice the change you made to Transmission.
(b) Create and store two variables as vectors: mpg for automatic vehicles and mpg for manual vehicles.
(c) Find the sample mean, median, variance and standard deviation for each variable from part (b).
(d) Create a boxplot(s) comparing both variables from part (b). Both boxplots should be in the same image and make
sure to include the appropriate labels and title. Discuss the following (refer to the boxplots when applicable):
(i) Compare the sample median to the sample mean for each variable.
(ii) Compare the sample medians of the two variables.
(iii) Compare the variability of the two variables.
Transcribed Image Text:1. mpg: Miles/(US) gallon 2. cyl: Number of cylinders 3. disp: Displacement (cu.in.) 4. hp: Gross horsepower 5. drat: Rear axle ratio 6. wt: Weight (1000 lbs) 7. qsec: 1/4 mile time 8. Vs: V/S 9. am: Transmission (0 = automatic, 1 = manual) 10. gear: Number of forward gears 11. carb: Number of carburetors Use R. and its built-in data set mtcars to complete the following. (a) Explore the structure of the data set. Notice that the variable Transmission is stored as numeric, but the description says it is a binary variable (categorical). Change the variable Transmission into a factor (categorical variable). Make sure you name the levels of this categorical variable (follow the order in the description). Now check the structure of your data set and notice the change you made to Transmission. (b) Create and store two variables as vectors: mpg for automatic vehicles and mpg for manual vehicles. (c) Find the sample mean, median, variance and standard deviation for each variable from part (b). (d) Create a boxplot(s) comparing both variables from part (b). Both boxplots should be in the same image and make sure to include the appropriate labels and title. Discuss the following (refer to the boxplots when applicable): (i) Compare the sample median to the sample mean for each variable. (ii) Compare the sample medians of the two variables. (iii) Compare the variability of the two variables.
Expert Solution
steps

Step by step

Solved in 4 steps with 15 images

Blurred answer
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
A First Course in Probability (10th Edition)
A First Course in Probability (10th Edition)
Probability
ISBN:
9780134753119
Author:
Sheldon Ross
Publisher:
PEARSON
A First Course in Probability
A First Course in Probability
Probability
ISBN:
9780321794772
Author:
Sheldon Ross
Publisher:
PEARSON