Welcome to Assignments Writing

Your Trusted Partner in Term Paper Writing

At Assignments Writing, we’re a team of passionate educators and skilled writers committed to supporting students in their academic journey.

CSUGC Programming Linear Regression Modeling Questions

CSUGC Programming Linear Regression Modeling Questions

ANSWER

  1. Load the R package MASS and its Cars93 data set:
R
library(MASS)
data("Cars93")
  1. How many rows does the Cars93 data set have?

You can use the nrow() function to determine the number of rows:

R
num_rows <- nrow(Cars93)
num_rows
  1. What are the names of the variables in the Cars93 data set?

You can use the names() function to get the variable names:

R
variable_names <- names(Cars93)
variable_names
  1. What are the summary statistics of the variables EngineSize and MPG.city?

You can use the summary() function to obtain summary statistics for specific variables:

R
summary_engine_size <- summary(Cars93$EngineSize)
summary_mpg_city <- summary(Cars93$MPG.city)

summary_engine_size
summary_mpg_city

  1. Subset the Cars93 data set into a smaller data set as described:
R
# Calculate the median of EngineSize
median_engine_size <- median(Cars93$EngineSize)

# Subset the data
smaller_data <- subset(Cars93, EngineSize >= median_engine_size, select = c("EngineSize", "MPG.city"))

  1. How many rows in the smaller data set?

You can use the nrow() function as before:

R
num_rows_smaller <- nrow(smaller_data)
num_rows_smaller
  1. What are the names of the variables in the smaller data set?

Use the names() function on the smaller data set:

R
variable_names_smaller <- names(smaller_data)
variable_names_smaller
  1. What are the summary statistics of the variables EngineSize and MPG.city in the smaller data set?
R
summary_engine_size_smaller <- summary(smaller_data$EngineSize)
summary_mpg_city_smaller <- summary(smaller_data$MPG.city)

summary_engine_size_smaller
summary_mpg_city_smaller

  1. Display a scatter plot of the relationship between the two variables EngineSize and MPG.city:
R
# Install and load the ggplot2 package if you haven't already
# install.packages("ggplot2")
library(ggplot2)

# Create the scatter plot
ggplot(smaller_data, aes(x = EngineSize, y = MPG.city)) +
geom_point() +
labs(x = "EngineSize", y = "MPG.city") +
ggtitle("Scatter Plot of EngineSize vs. MPG.city")

Explanation:

  1. We start by loading the MASS package and the Cars93 dataset.
  2. We determine the number of rows in the Cars93 dataset using nrow().
  3. We obtain the variable names using the names() function.
  4. We calculate and display summary statistics for the EngineSize and MPG.city variables using summary().
  5. We create a smaller dataset by subsetting the Cars93 dataset based on the condition you mentioned.
  6. We determine the number of rows in the smaller dataset.
  7. We obtain the variable names in the smaller dataset.
  8. We calculate and display summary statistics for the EngineSize and MPG.city variables in the smaller dataset.
  9. We create a scatter plot using the ggplot2 package to visualize the relationship between EngineSize and MPG.city in the smaller dataset. You will need to have the ggplot2 package installed for this step.

Please note that you may need to install the ggplot2 package if it’s not already installed in your R environment. You can do this using install.packages("ggplot2").

CSUGC Programming Linear Regression Modeling Questions

Question Description

I’m working on a programming multi-part question and need the explanation and answer to help me learn.

 

Load the R package MASS, and its Cars93 data set, using the R command:

library(MASS)

and answer the following questions using R code:

    1. How many rows does the Cars93 data set has?
    2. What are the names of the variables in the Cars93 data set?
    3. What are the summary statistics of the variables EngineSize and MPG.city?
    4. Subset the Cars93 data set into a smaller data set that excludes vehicles with EngineSize less than the median of EngineSize and excludes all variables except the EngineSize and MPG.city variables.
    5. How many rows in the smaller data set?
    6. What are the names of the variables in the smaller data set?
    7. What are the summary statistics of the variables EngineSize and MPG.city in the smaller data set?
    8. Display a scatter plot of the relationship between the two variables of EngineSize and MPG.city.
  1. Explain your work, along with your screenshot
Place Your Order Here

Our Service Charter


1. Professional & Expert Writers: We only hire the best. Our writers are specially selected and recruited, after which they undergo further training to perfect their skills for specialization purposes. Moreover, our writers are holders of master’s and Ph.D. degrees. They have impressive academic records, besides being native English speakers.

2. Top Quality Papers: Our customers are always guaranteed papers that exceed their expectations. All our writers have +5 years of experience. This implies that all papers are written by individuals who are experts in their fields. In addition, the quality team reviews all the papers before sending them to the customers.

3. Plagiarism-Free Papers: All papers provided are written from scratch. Appropriate referencing and citation of key information are followed. Plagiarism checkers are used by the Quality assurance team and our editors just to double-check that there are no instances of plagiarism.

4. Timely Delivery: Time wasted is equivalent to a failed dedication and commitment. We are known for timely delivery of any pending customer orders. Customers are well informed of the progress of their papers to ensure they keep track of what the writer is providing before the final draft is sent for grading.

5. Affordable Prices: Our prices are fairly structured to fit all groups. Any customer willing to place their assignments with us can do so at very affordable prices. In addition, our customers enjoy regular discounts and bonuses.

6. 24/7 Customer Support: We have put in place a team of experts who answer all customer inquiries promptly. The best part is the ever-availability of the team. Customers can make inquiries anytime.

Format & Features

Our Advantages

How It Works

1. Fill Order Form
2. Make payment
3. Writing process
4. Download paper

Fill in the order form and submit all your files, including instructions, rubrics, and other information given to you by your instructor.

Once you complete filling the forms, complete your payment. We will get the order and assign it to a writer.

When your order is completed, it’s assigned to an editor for approval. The editor approves the order.

Once approved, we will upload the order to your account for you to download.  You can rate your writer or give your customer review.

What Clients Said

{

I am very satisfied! thank you for the quick turnaround. I am very satisfied! thank you for the quick turnaround.I am very satisfied! thank you for the quick turnaround.

5
Mercy M
{

I am very satisfied! thank you for the quick turnaround. I am very satisfied! thank you for the quick turnaround.I am very satisfied! thank you for the quick turnaround.

5
Jane L
{

I am very satisfied! thank you for the quick turnaround. I am very satisfied! thank you for the quick turnaround.I am very satisfied! thank you for the quick turnaround.

4.5
Rayan M

LET US DELIVER YOUR ACADEMIC PAPER ON TIME!

We are a freelance academic writing company geared towards provision of high quality academic papers to students worldwide.

Open chat
1
Scan the code
Hello
Can we help you?