solved Problem 1. Â Use plot(density()) to examine the smooth estimated

Problem 1.  Use plot(density()) to examine the smooth estimated density function (PDF) for variable hp (horsepower) in data frame mtcars.
–Use attach(mtcars) so you can refer to hp
How many peaks (0, 1, 2, 3, or more) does the estimated PDF for hp have?
(Answer in the numerical form e.g., 4)
Group of answer choices
1
Question 2
Problem 2. Create a stem-and-leaf diagram for variable mpg in data frame mtcars, and use it to answer the following question:
How many stems (rows) are there?  
How many cars belong to the second stem?  
–Example:  for stem(eruptions), there are 18 stems (rows). 
–5 eruptions belong to the 5th stem:  24 | 00228
–The corresponding data values are: 2.400 2.400 2.417 2.417 2.483
Can view these values using sort(eruptions)
Question 3
Problem 3. Fit a normal distribution to the variable hp in mtcars (i.e., estimate the parameters of the normal distribution by MLE).
–Use fitdist() in package fitdistrplus
What is the estimated standard deviation of the best-fitting (MLE) normal distribution?
–For mpg, it was sd* = 5.93203
(Answer up to 5 decimal places)
Question 4
Problem 4. Fit an exponential distribution to mtcars$hp by MLE using fitdist() in package fitdistrplus.
–First, use attach(mtcars) or data(mtcars) 
–Then use library(fitdistrplus)

First install fitdistrplus package with install.packages(“fitdistrplus”)

–Use the fitdist() function, with “exp” (with the quotes) as an argument, to tell fitdistrplus to fit an exponential distribution
–Name the result so you can plot it with denscomp()
Plot fitted distribution using denscomp()
The exponential distribution has a single parameter (“rate”).  What is the MLE estimate of rate for variable hp?
–Use print(fit_name) to see, where fit_name is whatever you named your fitsdist() result
–Ignore the standard error
(Answer up to 4 decimal places)
Question 5
Problem 5. Use kstest() to decide whether the null hypothesis that variable hp in the mtcars data frame has an exponential distribution can be rejected with 95% confidence. 
–Remember to attach(mtcars)
–Remember to use set.seed(1)
–Then use ks.test(hp, rexp(100, rate = )) as a template for your test of whether hp and the best-fitting exponential distributions have significantly different CDFs
–Plug the MLE value for rate (from your previous results from fitdist() for hp) into the above template

What is the p-value for this hypothesis test?
What should we conclude? 

(Please input the p-value in the answer tab up to 5 decimal places)
Question 6
Problem 6. Use shapiro.test() to decide whether we can reject with 95% confidence (a = 5% significance level) the null hypothesis that variable hp in the mtcars data frame has a normal distribution.

What is the p-value for this hypothesis test?

–For mpg, it is 0.1229.  What is it for hp? 
–Remember that we reject a null hypothesis at significance level a (confidence level 1- a) if the p-value (tail area) of the test < a. (Answer up to 4 decimal places) Question 7 Problem 7.  Using plot(density()), do you think the Age variable in the survey data set in package MASS is left-skewed, right-skewed, or neither? (Please input left-skewed, right-skewed, or neither in the answer tab) Question 8 Problem 8. Using boxplot(), how many outliers do you see for variable Pulse in the survey data set in package MASS? –Remember to load MASS using library(MASS) before using attach(survey) or survey$Pulse

Looking for an Assignment Help? Order a custom-written, plagiarism-free paper

Order Now