current_wd <- getwd() cat(“my working directory:”)

suggested_folders <- c(“data”, “code”, “outputs”, “figures”)

required_packages <- c( “tidyverse”, “rmarkdown”, “knitr”, “ggplot2”, “dplyr”, “car”, “lmtest”, “sandwich”, “stargazer”, “broom” )

for (pkg in required_packages) { if (!require(pkg, character.only = TRUE)) { install.packages(pkg, dependencies = TRUE) } }

cat(“✓ Installation complete! Restart R (Ctrl+Shift+F10) and run this document again.”)

cat(“Suggested folder structure:”)

cat(“Number of observations:”, nrow(mtcars), “”) cat(“Number of variables:”, ncol(mtcars), “”)

Summary statistics

cat(“Summary of Miles Per Gallon (mpg):”) summary(mtcars$mpg)

cat(“Dataset: mtcars (Motor Trend Car Road Tests)”)

p <- mtcars %>% ggplot(aes(x = wt, y = mpg, color = factor(cyl))) + geom_point(size = 3, alpha = 0.7) + labs( title = “Fuel Efficiency vs Weight”, subtitle = “EPI 553 - Setup Test”, x = “Weight (1000 lbs)”, y = “Miles Per Gallon (mpg)”, color = “Cylinders” ) + theme_minimal() + theme(plot.title = element_text(size = 14, face = “bold”))

print(p)

model <- lm(mpg ~ wt + factor(cyl), data = mtcars) cat(“Linear Regression Model: mpg ~ weight + cylinders”)

print(summary(model))

#section 5: the model fit the data well, explaining about 84% of the variation in mpg and is statistically significant.

#section 6: one issue I had was getting the scatter plot to show instead of the code, I was unable to figure out the problem so I will be asking questions to figure out what went wrong.