Difference between revisions of "Worksheets/Week3"

From Statistics for Engineering
Jump to navigation Jump to search
Line 91: Line 91:
interaction.plot(S, P, y)
interaction.plot(S, P, y)
interaction.plot(P, S, y)
interaction.plot(P, S, y)
    </code>
</div></html>
=== Part 4 ===
Continuing with the case above:
<html><div data-datacamp-exercise data-lang="r" data-height="500px">
    <code data-type="sample-code">
# S = Free shipping if order amount is €30 or more [-1],
# of if order amount is over €50 [+1]
S <- c(-1, +1, -1, +1, -1, +1, -1, +2)
# Does the purchaser need to create a profile first [+1] or not [-1]?
P <- c(-1, -1, +1, +1, -1, -1, +1, +1)
# Response: daily sales amount
y <- c(348, 359, 327, 243, 356, 363, 296, 220)
# Linear model using S, P and S*P to predict the response
mod.sales.mistake <- lm(y ~ S*P)
summary(mod.sales.mistake)
# Uncomment this line if you run the code in RStudio
#library(pid)
# Comment this line if you run this code in RStudio
source('https://yint.org/contourPlot.R')
contourPlot(mod.sales.mistake)
     </code>
     </code>
</div></html>
</div></html>

Revision as of 16:23, 10 March 2019

Part 1

A factorial experiment was run to investigate the settings that minimize the production of an unwanted side product. The two factors being investigated are called A and B for simplicity.


Part 2

Continuing from above, with 2 extra experimental points:


Part 3

Your family runs a small business selling products online. The first factor of interest is whether to provide free shipping over €30 or over €50. The second factor is whether or not the purchaser must first create a profile before completing the transaction. The purchaser can still complete their transaction without creating a profile. Below are the data collected, showing the 8 experiments.


Part 4

Continuing with the case above: