15 Complete Second Order Models
library(tidyverse)
source("~/rstudioshared/IRamler/scripts/slunova.R") # for ANOVA test
Many companies manufacture products that are at least partially produced using chemicals (for example, steel, paint, gasoline). In many instances, the quality of the finished product is a function of the temperature and pressure at which the chemical reactions take place.
Suppose you want to model the quality, y, of a product was a function of the temperature and the pressure. Four inspectors independently assign a quality score (between 0 and 100) to each product, and then the quality, y, is calculated by averaging the four scores. An experiment was conducted by varying the temperature between 80o and 100o F and pressure between 50 and 60 psi (pounds per square inch). The data are available in ProductQuality.CSV.
= read_csv("data/ProductQuality.CSV") pqdata
The engineers believe that a complete second-order model would adequately describe the relationship between product quality and the two predictors (temperature and pressure). Write out the general form of this model:
Use R to fit the complete second-order model. Write the fitted prediction equation below.
<- lm(Quality ~ Temperature + Pressure +
mod I(Temperature^2) + I(Pressure^2) +
*Pressure , data = pqdata
Temperature
)summary(mod)
Is there evidence that the overall model is useful?