Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please answer using R or RStudio. I will upvote! I AM USING THIS TO STUDY! The following information relates to a sample of 15 cars

Please answer using R or RStudio. I will upvote! I AM USING THIS TO STUDY!

image text in transcribedimage text in transcribed
The following information relates to a sample of 15 cars regarding their model, weight (in 1000 lbs), number of cylinders, miles per gallon, displacement (cu.in.) and gross horsepower. model: c("Honda Civic", "AMC Javelin", "Merc 240D", "Duster 360" "Datsun 710", "Lincoln Continental", "Merc 280C", "Merc 450SLC", "Ferrari Dino", "Cadillac Fleetwood", "Ford Pantera L", "Porsche 914-2", "Fiat X1-9", "Merc 450SL", "Valiant") wgt: 1.615 3.435 3. 190 3.570 2.320 5.424 3.440 3.780 2.770 5.250 3.170 2.140 1.935 3.730 3.460 cyl: 4, 8, 4, 8, 4, 8, 6, 8, 6, 8, 8, 4, 4, 8, 6 mpg: 30.4 15.2 24.4 14.3 22.8 10.4 17.8 15.2 19.7 10.4 15.8 26.0 27.3 17.3 18.1 disp: 75.7 304.0 146.7 360.0 108.0 460.0 167.6 275.8 145.0 472.0 351.0 120.3 79.0 275.8 225.0 hp: 52 150 62 245 93 215 123 180 175 205 264 91 66 180 105(a) Read this data into six vectors-model, wet, cyl, mpg, disp, hp. (b) Create a dataframe-dat using six vectors in (a). (c) Print fist and last two observations of the dataframe in (b) (d) Write a function to output the following quantities as a list for a vector of data. the data vector range five number summary 3 quartiles IQR (e) Using the function defined in (d), print the list of outputs for the vectors mpg and wgt. (f) Add a column vector id with values 1-15 with the dataframe dat, and print first 3 observations of the updated dataframe dat. (g) Create a new dataframe dat with observations 7-15 of the dataframe dat. (h) Create a new dataframe dat3 with 10th and 14th observations from the dataset dat removed, and print dat3. (i) Make a boxplot of the original vector mpg. What can you say about the shape of the distribution of mpg? ()) Make a boxplot of the original vector wgt. What can you say about the shape of the distribution of wgt

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Linear Algebra With Applications

Authors: Gareth Williams, Williams

9th Edition

1284120104, 9781284120103

More Books

Students also viewed these Mathematics questions

Question

7. Identify six intercultural communication dialectics.

Answered: 1 week ago