Exploratory data analysis
#Boxplot
boxplot(Computers$price~Computers$speed,xlab="Clock speed in MHz",ylab="Computer price")

boxplot(Computers$price~Computers$hd,xlab="Size of hard drive in MB",ylab="Computer price")

boxplot(Computers$price~Computers$ram,xlab="Size of Ram in MB",ylab="Computer price")

boxplot(Computers$price~Computers$screen,xlab="Size of screen in inches",ylab="Computer price")

From plots above, it seems all 4 factors could influence the price of a computer. For Ram size and screen size, computer price increases as they increase. However for clock speed, the means of price among computers with speed from 25MHz to 66 MHz are different, while there is no obvious difference when speed changes from 66MHz to 100MHz. There is no clear relationship between computer price and size of hard drive.
Response surface method using rsm:
#Construct linear model and run rsm
Cmpt.lm=lm(price~speed+hd+ram+screen,data=Computers)
anova(Cmpt.lm)
## Analysis of Variance Table
##
## Response: price
## Df Sum Sq Mean Sq F value Pr(>F)
## speed 1 1.91e+08 1.91e+08 1046 <2e-16 ***
## hd 1 2.48e+08 2.48e+08 1358 <2e-16 ***
## ram 1 4.76e+08 4.76e+08 2603 <2e-16 ***
## screen 1 5.31e+07 5.31e+07 291 <2e-16 ***
## Residuals 6254 1.14e+09 1.83e+05
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
library(rsm)
## Warning: package 'rsm' was built under R version 3.1.2
Cmpt.rsm=rsm(price~SO(speed,hd,ram,screen),data=Computers)
summary(Cmpt.rsm)
##
## Call:
## rsm(formula = price ~ SO(speed, hd, ram, screen), data = Computers)
##
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 1.34e+04 1.40e+03 9.53 < 2e-16 ***
## speed 1.04e+01 4.56e+00 2.28 0.02243 *
## hd 3.71e+00 5.51e-01 6.72 1.9e-11 ***
## ram 1.07e+02 2.28e+01 4.70 2.7e-06 ***
## screen -1.79e+03 1.84e+02 -9.72 < 2e-16 ***
## speed:hd -1.41e-02 1.72e-03 -8.20 2.9e-16 ***
## speed:ram 2.57e-01 7.15e-02 3.59 0.00033 ***
## speed:screen 6.24e-01 3.13e-01 1.99 0.04641 *
## hd:ram -5.26e-02 7.97e-03 -6.60 4.4e-11 ***
## hd:screen -2.89e-01 3.81e-02 -7.59 3.7e-14 ***
## ram:screen 5.50e-01 1.56e+00 0.35 0.72370
## speed^2 -8.41e-02 1.14e-02 -7.41 1.5e-13 ***
## hd^2 1.11e-03 8.23e-05 13.52 < 2e-16 ***
## ram^2 -6.86e-01 3.15e-01 -2.18 0.02932 *
## screen^2 6.44e+01 6.04e+00 10.66 < 2e-16 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Multiple R-squared: 0.522, Adjusted R-squared: 0.521
## F-statistic: 487 on 14 and 6244 DF, p-value: <2e-16
##
## Analysis of Variance Table
##
## Response: price
## Df Sum Sq Mean Sq F value Pr(>F)
## FO(speed, hd, ram, screen) 4 9.68e+08 2.42e+08 1497.7 <2e-16
## TWI(speed, hd, ram, screen) 6 6.96e+07 1.16e+07 71.8 <2e-16
## PQ(speed, hd, ram, screen) 4 6.41e+07 1.60e+07 99.1 <2e-16
## Residuals 6244 1.01e+09 1.62e+05
## Lack of fit 547 5.61e+08 1.03e+06 13.0 <2e-16
## Pure error 5697 4.48e+08 7.87e+04
##
## Stationary point of response surface:
## speed hd ram screen
## 41.85 1583.28 32.01 17.13
##
## Eigenanalysis:
## $values
## [1] 64.369987 0.003605 -0.061810 -0.713299
##
## $vectors
## [,1] [,2] [,3] [,4]
## speed 0.004849 -0.165577 0.966058 0.198225
## hd -0.002250 0.983905 0.175515 -0.033471
## ram 0.004236 -0.067114 0.189475 -0.979580
## screen 0.999977 0.003301 -0.005093 0.003113
From anova and summary of Cmpt.rsm, we can find out that all four factors alone, combinations of any two factors except for ram:screen, and pure quadratic of all four factors are statistically significant and probably explain variance of computers price.
Therefore we can reject the null hypothesis and accept the alternative hypothesis that variance of computers price can be explained by something other than randomizaion.
For second order effects, FO, TWI and PQ all return a p-value equals 0, indicating statistical significance.
Stationary point of response surface: speed(41.85), hd(1583.28), ram(32.01) and screen(17.13).
Response surface characterization through eigenanalysis values:
speed(64.37), hd(0.004), ram(-0.062) and screen(17.13)
Contour plots of response surface
par(mfrow=c(2,3))
contour(Cmpt.rsm, ~speed+hd+ram+screen, image=TRUE, at=summary(Cmpt.rsm$canonical$xs))

From plots above, we can find out how combinations of any two factors effect computer price. It is important to point out that from the ram:screen plot, it seems that only ram plays a role in determination of price, which corresponds analysis of variance above. However from the speed:ram plot, it seems speed plays a more significant role than ram.
3D plots are as below:
library(rgl)
## Warning: package 'rgl' was built under R version 3.1.2
par(mfrow=c(1,1))
persp(Cmpt.rsm, ~ speed+hd, image = TRUE,
at = c(summary(Cmpt.rsm)$canonical$xs),zlab="Computer price",col.lab=33,contour="colors")
## Warning: "image"不是图形参数
## Warning: "image"不是图形参数
## Warning: "image"不是图形参数

persp(Cmpt.rsm, ~ speed+ram, image = TRUE,
at = c(summary(Cmpt.rsm)$canonical$xs),zlab="Computer price",col.lab=33,contour="colors")
## Warning: "image"不是图形参数
## Warning: "image"不是图形参数
## Warning: "image"不是图形参数

persp(Cmpt.rsm, ~ speed+screen, image = TRUE,
at = c(summary(Cmpt.rsm)$canonical$xs),zlab="Computer price",col.lab=33,contour="colors")
## Warning: "image"不是图形参数
## Warning: "image"不是图形参数
## Warning: "image"不是图形参数

persp(Cmpt.rsm, ~ hd+ram, image = TRUE,
at = c(summary(Cmpt.rsm)$canonical$xs),zlab="Computer price",col.lab=33,contour="colors")
## Warning: "image"不是图形参数
## Warning: "image"不是图形参数
## Warning: "image"不是图形参数

persp(Cmpt.rsm, ~ hd+screen, image = TRUE,
at = c(summary(Cmpt.rsm)$canonical$xs),zlab="Computer price",col.lab=33,contour="colors")
## Warning: "image"不是图形参数
## Warning: "image"不是图形参数
## Warning: "image"不是图形参数

persp(Cmpt.rsm, ~ ram+screen, image = TRUE,
at = c(summary(Cmpt.rsm)$canonical$xs),zlab="Computer price",col.lab=33,contour="colors")
## Warning: "image"不是图形参数
## Warning: "image"不是图形参数
## Warning: "image"不是图形参数

For hd:speed plot, stationary point (1583.28, 41.85) seems to be a ridge point. For ram:speed plot, stationary point (32.01, 41.85) seems to be a ridge point. For screen:speed plot, stationary point (17.13, 41.85) seems to be a saddle point . For ram:hd plot, stationary point (32.01, 1583.28) seems to be a saddle point. For screen:hd plot, stationary point (17.13, 1583.28) seems to be a minima point. For screen:ram plot, stationary point (17.13, 32.01) might be a maxima or ridge point.