Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Help please by using R studio. Edit View History Bookmarks Window Help O . . . O Quiz 1 - labdelhalim411@hcc.edu You will use RStudio

image text in transcribedimage text in transcribedimage text in transcribed

Help please by using R studio.

image text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedimage text in transcribed
Edit View History Bookmarks Window Help O . . . O Quiz 1 - labdelhalim411@hcc.edu You will use RStudio to generate all statistics and graphs. . VERY IMPORTANT: You must only use functions seen in class and in the google docs, using the mosaic style of code: function (~ variable, data = ... For questions that require R, copy and paste your code that you typed into RStudio along with the output (either numbers or a graph) that RStudio gives you. Paste the code and the output below each question. No credit given if you don't give your code! If you have difficulties copy/pasting, please see the video I put in the quiz email or email me! . Please type your name to acknowledge that you understand and accept the policies. NAME: Begin by loading your mosaic and tibble packages by checking them under the Packages tab. You will be generating summary statistics and statistical graphs for variables in a data frame called mtcars. The data frame comes from the 1974 Motor Trend magazine, and it contains fuel consumption aspects of automobile design and performance for some cars that are 1973-74 models. This data is already available in RStudio. You can look at the data by typing the name of the data set mtcars in the RStudio console. You can also see the data using view (mtcars) . PARTI. #1. Use an R function that gives the dimensions of the data frame. (By dimensions, we mean the number of rows and columns. Paste the code and output here.File Edil View History Bookmarks Window Help El - '5' Q . . . E: 0 [E] l i mail.google.com G j; I. 't Cause: FAZLHm403 - Principles of Marketing M Statistics Data Project -> Quiz 1 - labdelhalim411@hcc.edu - H5 in; #2. Based on the dimensions of the data, how many cars are there? How many variables? #3. Use an R function that gives the names of all the variables in the data frame. Paste the code and output here. PLEASE NOTE! the variable names alone don't tell you what the variables actually are. To see what the variables mean, type: ?mtcars in the console. On the right side of the screen, the HELP tab will show you more information. Notice the rst variable in the data frame is mpg, the number of miles per gallon of gasoline-- a measure of a car's fuel efcaency. We will now generate summary statistics and graphs for the mpg values from all the cars in the data set. Let's start by creating a histogram to look at the shape of the data. #4. Make a histogram of the mpg data. Give your histogram a border color and a ll color. Let's make a histogram with exactly 7 bins. To do this, include in your code bins = 7. Copy and paste your R code and your histogram here: Window Help FJe Edit View History Bookmarks 9 mail.google.com c. m CDII'II: FA21_MKT2'0.03 - Principles of Marketing M Statistics Data Project -> Quiz 1 - labdeihallmd11hcc.ec #6. Now we will get some basic summary statistics. Fill in the table below. (HINT: one R function will give you all your \"favorite statistics" with just one iine of code.) Standard Deviation Copy and paste the R code you used to get the values you entered in the table: #7. In words, explain the real meaning of 9,1. What information does the value of Q1 tell us about the mpg data? #8. In words, explain the real meaning of Median. What information does it tell us about the mpg data? #9. In words, explain the real meaning of Q3. What information does it tell us about the mpg data? #10. Use a R function to find the IQR of mpg. Copy and paste the R code and output here. #11. In words, explain the real meaning of IQR. What information does it tell us about the mpg data? #12. Calculate the upper and lower boundaries (fences) that define a "safe range" for the data. You can use R or a calculator, but either way please show your work (type out your calculations) to explain your reasoning!ED CE 9 mail.google.com C To Course: FA21_MKT240.03 - Principles of Marketing M Statistics Data Proiect > Quiz 1 - Iabdelhaiimzf'li #13. Based on your answer to #12, determine if there are any outliers in the data set. If there are any outliers, state the car's name and its mpg value. HINT: It might be helpful to arrange the rows ofthe data frame in order from lowest to highest mpg. To do this, make sure the tibble package is installed and loaded. and type View (mtcars) . Now go to the tab that opened and click on the mpg column header at the very top of the first column. This will sort all the rows of the data frame for you according to the values of the mpg variable. Click it multiple times to see that it will sort in ascending or descending order. #14. Make a boxpiot of the mpg data. Paste your R code and your boxplot here. (Does your answer in #13 agree with what you see here?) #15. Briefly describe what each of the major features of the boxplot represents. In other words, please describe which summary statistics and other important aspects of the data can be seen in the boxplot! Try not to miss anything! ~i z-Iin oil-ETTA\" t3 #16. The variables gear and cyl are recorded as numbers, but we can actually view them as categorical variables where the numbers are the levels of the category. For example, the only values of gear are 3, 4, 5 so we can think of this as "low, medium, high". The same is true for the three values of cyl which are 4, 6, 8. Since we can view these as categorical, please make a single mosaic plot that displays these two categorical variables. Copy and paste your R code and your mosaic plot here. (HINT: remember to first install and load the ved package to use this function.) #17. Based on your mosaic plot, which combination of gears and cylinders is the most common in the data set? #18. Based on your mosaic plot, which combination of gears and cylinders is the least common in the data set? (HINT: is there any combination(s) of gear and cylinder missing from this plot? If so, what does that mean?)_,, . . i......._.__.... _-y._ .n..- PART II. We will now explore how three other predictor (explanatory) variables in the data frame relate to mpg as a response variable. #19. Construct a scatterplot that has mpg on the y-axis and drat (rear axle ratio) on the x- axis. Paste your code and plot here. #20. Choose one that best describes the relationship between the variables mpg & drat. Bold/Underline your answer. a) Positive Linear b) Negative Linear c) Positive Nonlinear d) Negative Nonlinear e} No Association #21. Construct a scatterplot that has mpg on the yaxis and wt (weight of car) on the x-axis. Paste your code and plot here. #22. Choose one that best describes the relationship between the variables mpg and wt. Bold/Underline your answer. a) Positive Linear b) Negative Linear c) Positive Nonlinear d) Negative Nonlinear e) No Association #23. Construct a scatterplot that has mpg on the y-axis and hp (horsepower) on the x-axis. Paste your code and plot here. #24. Choose one that best describes the relationship between the variables mpg and hp. Bold/Underline your answer. I a) Positive Linear b) Negative Linear c) Positive Nonlinear d) Negative Nonlinear e) No Association #25. For this last question, let's focus on the idea of a linear relationship (straight line, not curved). Looking at all three plots, which of the three variables do you think is most closely associated (highly correlated) with the mpg variable in a linear way? In other words, for which of these three variables would a straight line be the most accurate way to model (represent) what the data look like? Explain your reasoning!BONUS QUESTIONS! #1. For each of the three cases you explored above in questions #19-25, you will now find the Pearson Correlation Coefficient for each case. Copy and paste your code and output below for each of the same three cases. After pasting the code and output, interpret the meaning of each correlation value; in other words, very briefly explain what the correlation value is telling us about the relationship between the two variables in each case. mpg and drat (Copy/paste the code & output and explain what this correlation value tells us.) mpg and wt (Copy/paste the code & output and explain what this correlation value tells us.) mpg and hp (Copy/paste the code & output and explain what this correlation value tells us.) #2. Use your three correlation values to explain which of the three variables drat , wt or hp is most linearly related to the variable mpg and why. Try to connect this to your answer to question #25

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered 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

Advanced Accounting

Authors: Joe Hoyle, Thomas Schaefer, Timothy Doupnik

10th edition

0-07-794127-6, 978-0-07-79412, 978-0077431808

Students also viewed these Mathematics questions