QuestionQuestion

The following questions concern the built-in R dataset called “mtcars”. First, read in the dataframe using the following code: data(“mtcars”) and inspect the first 6 lines using the head() command. We observed last class that fuel efficiency (which we measured using the mpg variable) varied largely by car transmission type.
a. To estimate fuel efficiency by transmission type, use the subset command to split the data into automatic and manual cars (e.g., manual<-subset(mtcars, mtcars$am==1). You should have three different dataframes.
b. Calculate the sample size for the manual and automatic samples you created dataframes for in part a. How many cars for each transmission type are there?
c. Calculate your point estimate for the sample mean of mpg (̅x) for each car transmission type. You should have two point estimates.
d. What are the 99% confidence interval estimates for the population mpg of automatic and manual cars? (Be careful here. Are you using the correct test statistic?)
e. You recall from Assignment 3 that the long-run fuel efficiency of cars using historical Motor Trends data is 22.9 mpg with a standard deviation of 5.1 mpg. You believe manual cars are more fuel efficient (get more mpg) than this overall average. Test this hypothesis at the 1% significance level using the t.test command. What can you conclude?

(*) To compile report: Go to the "File" menu and select "Compile Notebook". Hit the "Compile" button and then select HTML, PDF, or Word (whichever works). If this isn't working for you, double check the following:
1) There are no errors in your code; if you’re seeing red when you run the full script, you’ll need to comment out the error (place an “#” before the line) or simply erase it from your script;
2) You do not have a data window open and a View() command is not in your script;
3) There are no special characters in your code (e.g., ≤, ≥, µ);
4) You do not have an HTML, PDF, or Word file with the same name as your R script in your working directory (delete it and try again if this is the case); the name of your compiled report will match the name of your R script file, so if you try to create a report with the same name as an existing one you may get an error;
5) Try “Knit document” from the “File” menu instead of “Compile Notebook”.

Solution PreviewSolution Preview

These solutions may offer step-by-step problem-solving explanations or good writing examples that include modern styles of formatting and construction of bibliographies out of text citations and references. Students may use these solutions for personal skill-building and practice. Unethical use is strictly forbidden.

```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
```

## Loading Dataset
```{r}
data("mtcars")
head(mtcars)
```

### (a)
```{r}
manual <-subset(mtcars, mtcars$am == 1)
automatic <-subset(mtcars, mtcars$am == 0)
```

### (b)
```{r}
no.cars.manual <- nrow(manual)
no.cars.automatic <- nrow(automatic)

# Samples in Manual
print(no.cars.manual)

# Samples in Automatic
print(no.cars.automatic)
```...

By purchasing this solution you'll be able to access the following files:
Solution.pdf and Solution.Rmd.

$15.00
for this solution

PayPal, G Pay, ApplePay, Amazon Pay, and all major credit cards accepted.

Find A Tutor

View available Statistics-R Programming Tutors

Get College Homework Help.

Are you sure you don't want to upload any files?

Fast tutor response requires as much info as possible.

Decision:
Upload a file
Continue without uploading

SUBMIT YOUR HOMEWORK
We couldn't find that subject.
Please select the best match from the list below.

We'll send you an email right away. If it's not in your inbox, check your spam folder.

  • 1
  • 2
  • 3
Live Chats