PSTAT122: Design and Analysis of Experiments

Author

Winter 2026

STUDENT NAME

  • Ethan Chuang (A1V2819)
  • Ryan Chang (A096381)
  • Daniel Larson (A3E8Y73)
CautionDue Date

Due Date: Monday, March 16, 2026, 11:59 PM

1 Introduction

In this experiment, we will test how having a “follower” car affects the distance a “lead” car can travel. More specifically, we are trying to test if the aerodynamic efficiency of the lead car can be improved by having a secondary car that is drafting behind it. Using the main effects of vehicle geometry and drafting, we will conduct a factorial experiment to test if the individual effects as well as the effect of their interaction have any affect on of the vehicle’s distance.

In the real world, shipping companies are starting to use “platoons,” where trucks drive very close together to save fuel. Our results could help show which geometric shape of vehicles save the most energy when driving in these groups in order to create more efficient transportation systems.

We predict that the biggest improvement will happen when a boxy car has a follower. This is because big cars usually are not very efficient for aerodynamics due to the way the air does not slide easily around them and creates a large vacuum behind it. Hopefully a following car should fill the vacuum and make it more efficient to move with another car than when it drives alone.

2 Experimental Design

In this experiment, we are measuring the distance from the total distance that the car is traveling in centimeters by using a tape measure that runs along the edge of the track. The total distance will help us determine if each of the factors have an impact on the aerodynamic efficiency of each car and factor.

The two factors we will be testing are car shape and drafting or not. The two different shapes of cars we will be testing is a car with a blocky shape and a car with a sleeker shape. The blocky shape has lots of concentrated surface area facing the front while the sleeker shape has surface area facing the front that is spread out to allow air to pass around it smoother.

We used a \(2^2\) Factorial Design to test each possible combination of our factors, testing the slick car and blocky car, each with and without a following car.

Factor 1: Car Structure

  • Blocky Car

  • Sleek Car

Factor 2: Drafting?

  • With Drafting

  • Without Drafting

Both the car structure and drafting levels are fixed factors since we chose a car with a block design and sleek design and we choose to have drafting or not.

This made 4 different treatment groups, sleek car without drafting, sleek car with drafting, blocky car without drafting, and blocky car with drafting.

We measured the distance each of the cars starting from the top of the ramp to the final position of the tail end of the car using a tape measure that contained the distances in centimeters.

In order to account for bias and noise in this experiment, we used replication and randomization to conduct it. We ran each treatment 5 times, creating a total of 20 results, to reduce experimental variation in the conditions of the ramp, floor, and car and reduce any human error in releasing the car. We randomized the order of these 20 results by running a function in R, sample(). (Appendix 1) This was used in order to account insure independence between variables in the form of any lurking variables such as difference in conditions of the car as more tests were ran on them or differences in the track as more tests were ran on it.

The entire testing process took about 45 minutes in order to set up the track, ramp and measuring tape, run the experiment using the predetermined random order, and record all the results.

3 Data Collection

The experiment was conducted in the apartment of a group member on the hardwood floor of a kitchen. The ramp was constructed by books stacked on top of each other with a piece of cardboard leaning on it to create a slanted surface for the cars to run down. A track was constructed with cutting boards and the tape measure to make sure the cars ran in a semi-straight line.

Each test was run in order according to the predetermined randomization process with one group member releasing the car, one measuring the car distance, and the other recording the results.

Each car was placed with its tail end at the top of the tape measure on the ramp and was let go from the top of the ramp and allowed to roll as far as it could with minimal interference from the track. Once the car had stopped, the tail end of the car was measured and recorded. For the tests that used a following car, “drafting”, behind the lead car, a similar setup was used. The following car was setup very close behind, but not touching, the lead car and was released from supposed rest at the same time the lead car was released. When measuring the distance of the drafting car experiment, the tail end of the lead car was measured.

The measurements were done in the direction of the tape measure, not accounting for any other direction that the car might have gone in.

Some difficulties we faced when collecting data came in the form of human and random error. The person releasing the car tried to release the cars with zero initial force to the best of their ability. The car themselves tended to veer away from the track unpredictably at times, causing the measurements to be not fully correct since the car moved in a non-linear path. In order to account for this, we used another straightedge to align a right angle with the tape measure so that we would get the most accurate distance the car traveled in the direction of the tape measure.

\(\underline{\text{Data Presentation:}}\)

Table of the data: (Appendix 2)

Condition Distance (cm)
blocky car, no draft 161
sleek car, draft 271
sleek car, no draft 231
blocky car, no draft 178
blocky car, draft 216
sleek car, no draft 244
blocky car, no draft 197
blocky car, draft 224
sleek car, no draft 256
sleek car, draft 266
blocky car, draft 202
sleek car, no draft 262
blocky car, draft 252
blocky car, no draft 201
sleek car, draft 272
sleek car, draft 298
sleek car, draft 297
blocky car, draft 234
sleek car, no draft 247
blocky car, no draft 158

Summary of the data: (Appendix 4)

Summary Results
Condition Trials Mean Time SD
blocky car, draft 5 225.6 18.84
blocky car, no draft 5 179.0 19.84
sleek car, draft 5 280.8 15.42
sleek car, no draft 5 248.0 11.90

4 Analysis

\(\underline{\text{Exploratory Data:}}\)

Boxplot of the data: (Appendix 3)

Using the boxplot table, we can visually see that across the four different experimental results, the sleek car with draft had better performance than the rest of the trials, with the sleek car seeming to also have higher results than the blocky car. However, both the draft of each respective car had seemingly higher results than the no draft test.

In order to evaluate the effects of the factors we used, we will conduct a two-way ANOVA test at the significance level \(\alpha = .05\). This code can be found in Appendix 6, along with the code verifying that the proper assumptions are met in order to run this test. These assumptions are the normality assumption, tested by the Shapiro-Wilk Test, and the homoscedasticity of variance assumption, tested by Bartlett’s Test.

The ANOVA model is represented by \(Y_{ijk}=\mu+\alpha_i+\beta_j+(\alpha\beta)_{ij}+\epsilon_{ijk}\), where

The ANOVA model used can be represented as \(Y_{ijk} = \mu + \alpha_i + \beta_j + (\alpha\beta)_{ij} + \epsilon_{ijk}\), where

  • \(Y_{ijk} =\) the distance traveled for car \(k\), using shape \(i\), using drafting \(j\)
  • \(\mu =\) the overall mean distance
  • \(\alpha_i =\) the effect of the shape
  • \(\beta_j =\) the effect drafting
  • \((\alpha\beta)_{ij} =\) the interaction effect of the two main effects
  • \(\epsilon_{ijk} \sim N(0, \sigma^2) =\) the random error term

Using the two tests mentioned above, we also test the assumptions for the ANOVA test (normality, homoscedasticity) are verified by checking if both tests return p-values of over .05 and visually through the Residual vs Fitted graph, Q-Q Residual graph, and Scale-Location graph.

For the shape main effect, we have the following hypothesis:

  • Null hypothesis: There is no difference in mean distance traveled between a car with a blocky shape and a car with a sleeker shape.
  • Alternative hypothesis: There is a difference in mean distance traveled between a car with a blocky shape and a car with a sleeker shape.

For the drafting main effect, we have the following hypotheses:

  • Null hypothesis: There is no difference in mean distance traveled between a car that is solo and a car that has another car drafting behind it.
  • Alternative hypothesis: There is a difference in mean distance traveled between a car that is solo and a car that has another car drafting behind it.

For the interaction effect between genre and volume, we have the following hypotheses:

  • Null hypothesis: The effect of the shape on mean distance traveled does not depend on the presence of a drafting car.
  • Alternative hypothesis: The effect of the shape on mean distance traveled does depend on the presence of a drafting car.

Hypothesis Testing:

Shapiro-Wilk Test
Statistic (W) P-Value Method
0.9483 0.3421 Shapiro-Wilk normality test
Bartlett’s Test
Statistic (K^2) P-Value Degrees of Freedom Method
1.072 0.7838 3 Bartlett test of homogeneity of variances
ANOVA Results
Df Sum Sq Mean Sq F value Pr(>F)
draft 1 7880.45 7880.45 27.96 0.00
shape 1 19282.05 19282.05 68.41 0.00
draft:shape 1 238.05 238.05 0.84 0.37
Residuals 16 4510.00 281.88 NA NA

Observing the Residuals vs Fitted graph, we can see that there is no heteroscedasticity since the red line is around 0 and fairly flat with the residuals randomly scattered around the line, suggesting that the data is homoscedastic. The Q-Q Residuals graph also shows that the data somewhat follows the diagonal dashed line closely, suggesting that the data is normal. However, the Scale-Location graph slows a slightly sloped line red line running through the graph, suggesting that there may be some differences in variance. Thankfully, observing the Shapiro-Wilk Test and Bartlett Test for normality and homogeneity of variances, we can see that both p-values are above .05, confirming that our data is normal and homoscedastic.

Using the results of the ANOVA table, we observe that the p-values of our main effects, draft and shape, are significant with values less than .05 and our interaction effect, draft:shape, does not have a significant p-value.

For our two main effects, we conclude to reject our null hypothesis in favor of our alternate hypothesis, determining that both draft and shape have a significant effect on the distance traveled of each car.

For the interaction effect between our two factors, we conclude to fail to reject our null hypothesis. There is not enough information to determine if the effect of the shape on mean distance traveled does not depend on the presence of a drafting car.

Running the code for the interaction plot of shape and draft (Appendix 5), we see that the two lines for mean shapes, blocky and sleek, plotted against draft and no draft, do not intersect each other anywhere on the graph. This confirms our result of the ANOVA table, suggesting that the interaction between shape and draft do not have an effect on each other.

5 Conclusions

The results from the two-way ANOVA test indicate that both of our main effects, shape and draft have a significant effect on the aerodynamic abilities of the hotwheel cars. This enabled them to travel a farther distance when set on a ramp. We also found that the effect of shape on the distance does not depend on drafting. Basically, if the shape improves the distance traveled, an improvement in drafting will not drastically improve the distance traveled. This is somewhat consistent with our initial prediction that both drafting and shape of the car will improve the distance the car travels. We did not observe that another car drafting behind the blocky car had a large enough effect on the distance traveled to find a significant interaction between drafting and car shape.

It is worth noting that this experiment was performed with store bought HotWheels cars that were chosen based on the overall visual shape of the car to determine our “shape” factor. Additionally, there could have various production defects which highly impact the consistency of distance the car rolled, such as friction in the axles of the cars or non 100% circular wheels. Furthermore, the track we constructed was not an official HotWheels track, but a homemade one using cardboard, cutting boards, a fairly clean kitchen floor, and a tape measure. That being said, the results of this experiment may not actually have significant effects in the real world even if the initial experiment was designed to test it.

An area that could be improved for this experiment is obtaining a more consistent testing setting with a real HotWheels track so that each trial had less variability in its environment. Also, more replications for each trial could be conducted in order to be more sure about the distribution for each trial, increasing certainty about the actual affects of each main effect. With these two improvements, the experiment is more likely to have significant results in a real world setting and assist real companies in the efficiency of their vehicles.

6 References

N/A

7 Appendices

1. Random Assignment

Code
set.seed(67)  
treatments <- rep(c("sleek car, no draft", "sleek car, draft ", "blocky car, no draft", "blocky car, draft"), each = 5)
sample(treatments)
 [1] "blocky car, no draft" "sleek car, no draft"  "blocky car, no draft"
 [4] "sleek car, draft "    "blocky car, no draft" "blocky car, draft"   
 [7] "blocky car, draft"    "blocky car, no draft" "sleek car, no draft" 
[10] "blocky car, draft"    "blocky car, no draft" "blocky car, draft"   
[13] "sleek car, draft "    "sleek car, no draft"  "sleek car, no draft" 
[16] "sleek car, draft "    "sleek car, no draft"  "sleek car, draft "   
[19] "sleek car, draft "    "blocky car, draft"   

2. Data Presentation

Code
data1 <- data.frame(
  assignment = c("blocky car, no draft", "sleek car, draft ", "sleek car, no draft", 
                 "blocky car, no draft", "blocky car, draft", "sleek car, no draft", 
                 "blocky car, no draft", "blocky car, draft", "sleek car, no draft", 
                 "sleek car, draft ", "blocky car, draft", "sleek car, no draft", 
                 "blocky car, draft", "blocky car, no draft", "sleek car, draft ", 
                 "sleek car, draft ", "sleek car, draft ", "blocky car, draft", 
                 "sleek car, no draft", "blocky car, no draft"),
  distance = c(161, 271, 231, 178, 216, 244, 197, 224, 256, 266, 202, 262, 252, 201, 272, 298, 297, 234, 247, 158)
)
knitr::kable(data1, col.names = c("Condition", "Distance (cm)"), align = "lc")

data <- data.frame(
  distance=c(161, 271, 231, 178, 216, 244, 197, 224, 256, 266, 202, 262, 252, 201, 272, 298, 297, 234, 247, 158),
  draft=c(0, 1, 0, 0, 1, 0, 0, 1, 0, 1, 1, 0, 1, 0, 1, 1, 1, 1, 0, 0),
  shape=c(0, 1, 1, 0, 0, 1, 0, 0, 1, 1, 0, 1, 0, 0, 1, 1, 1, 0, 1, 0)
)

3. Data Boxplot

Code
library(ggplot2)

ggplot(data1, aes(x = assignment, y = distance, fill = assignment)) +
  geom_boxplot(alpha = 0.7) + 
  geom_jitter(width = 0.1, color = "black", alpha = 0.6) +
  labs(title = "Car Distance: Impact of Shape and Drafting",
       x = "Vehicle Shape and Draft",
       y = "Distance (cm)") +
  theme_minimal() +
  theme(legend.position = "none")

4. Data Summary

Code
library(dplyr)
library(knitr)

summary_table <- data1 %>%
  mutate(assignment = trimws(assignment)) %>%
  group_by(assignment) %>%
  summarise(
    n = n(), 
    mean_time = mean(distance), 
    sd_time = sd(distance)
  )

kable(summary_table, 
      digits = 2, 
      col.names = c("Condition", "Trials", "Mean Time", "SD"),
      caption = "Summary Results")

5. Interaction Plot

Code
library(ggplot2)

plot_data <- data %>%
  group_by(draft, shape) %>%
  summarize(mean_distance = mean(distance), .groups = 'drop')

ggplot(plot_data, aes(x = shape, y = mean_distance, color = draft, group = draft)) + geom_line() + geom_point() + labs(title = "Interaction plot of Shape and Draft",
    x = "Shape (Blocky or Sleek)",
    y = "Mean Distance")

6. ANOVA Table and Assumptions

Code
library(dplyr)
library(knitr)
library(broom)
library(kableExtra)

model <- aov(distance ~ draft * shape, data=data)

par(mfrow = c(1, 2)) 
plot(model, which = 1:3)

shapiro_table <- shapiro.test(residuals(model)) %>%
  tidy()

kable(shapiro_table, col.names = c("Statistic (W)", "P-Value", "Method"), digits = 4, caption = "Shapiro-Wilk Test")

bartlett_table <- bartlett.test(distance ~ assignment, data = data1) %>%
  tidy()

kable(bartlett_table, col.names = c("Statistic (K^2)", "P-Value", "Degrees of Freedom", "Method"), digits = 4, caption = "Bartlett's Test")


aov_df <- as.data.frame(summary(model)[[1]])

kable(aov_df, digits = 2, caption = "ANOVA Results") |>
  row_spec(which(aov_df$`Pr(>F)` < 0.05), background = "white")