Question
This is data https://drive.google.com/file/d/1sz32tfzRPM1DgkDpm57ZL2pwVHYrG0oN/view?usp=sharing Run this code in R # Upload the epa data set # call the dataset cardata cardata = read.csv(file.choose(), header =
This is data
https://drive.google.com/file/d/1sz32tfzRPM1DgkDpm57ZL2pwVHYrG0oN/view?usp=sharing
Run this code in R
# Upload the epa data set
# call the dataset cardata
cardata = read.csv(file.choose(), header = TRUE)
View(cardata)
# This one is side by side boxplot
boxplot(FiveYearEstimatedCost~Guzzler, data = cardata,
main = "add title",
xlab = "add horizontal axis name",
col = c("red", "green"), ### add different color names
horizontal = TRUE)
# Calculate the mean, sd and sample sizes for five year fuel cost split among Guzzler and no Guzzler
# the command aggregate() will perform the given function on the specified groups
# aggregate(response~treatment, data = datasetname, function)
# Make a table of values with the results.
aggregate(FiveYearEstimatedCost~Guzzler, data = cardata, mean)
aggregate(FiveYearEstimatedCost~Guzzler, data = cardata, sd)
aggregate(FiveYearEstimatedCost~Guzzler, data = cardata, length)
# What type of vehicles are Guzzlers? Find out by subsetting the dataset to only include Guzzlers.
GuzzlersOnly = subset(cardata, Guzzler == "Guzzler")
View(GuzzlersOnly)
# Perform a two sample t test
# Use the same response~treatment format as the functions above.
# t.test(response~treatment, data = datasetname, conf.level = enterconfidencelevel, alternative = "two.sided" ))
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started