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.
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...
Related questions
Question
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
Step by step
Solved in 4 steps with 15 images
Recommended textbooks for you
A First Course in Probability (10th Edition)
Probability
ISBN:
9780134753119
Author:
Sheldon Ross
Publisher:
PEARSON
A First Course in Probability (10th Edition)
Probability
ISBN:
9780134753119
Author:
Sheldon Ross
Publisher:
PEARSON