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.

pqdata = read_csv("data/ProductQuality.CSV")

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.

mod <- lm(Quality ~ Temperature + Pressure + 
            I(Temperature^2) + I(Pressure^2) +
            Temperature*Pressure  , data = pqdata
          )
summary(mod)

Is there evidence that the overall model is useful?