whiteside                package:MASS                R Documentation

_H_o_u_s_e _I_n_s_u_l_a_t_i_o_n: _W_h_i_t_e_s_i_d_e'_s _D_a_t_a

_D_e_s_c_r_i_p_t_i_o_n:

     Mr Derek Whiteside of the UK Building Research Station recorded
     the weekly gas consumption and average external temperature at his
     own house in south-east England for two heating seasons, one of 26
     weeks before, and one of 30 weeks after cavity-wall insulation was
     installed. The object of the exercise was to assess the effect of
     the insulation on gas consumption.

_U_s_a_g_e:

     data(whiteside)

_F_o_r_m_a_t:

     The 'whiteside' data frame has 56 rows and 3 columns.:

     '_I_n_s_u_l' A factor, before or after insulation.

     '_T_e_m_p' Purportedly the average outside temperature in degrees
          Celsius. (These values is far too low for any 56-week period
          in the 1960s in South-East England. It might be the weekly
          average of daily minima.)

     '_G_a_s' The weekly gas consumption in 1000s of cubic feet.

_S_o_u_r_c_e:

     A data set collected in the 1960s by Mr Derek Whiteside of the
     UK~Building Research Station. Reported by

     Hand, D. J., Daly, F., McConway, K., Lunn, D. and Ostrowski, E.
     eds (1993) _A Handbook of Small Data Sets._ Chapman & Hall, p. 69.

_R_e_f_e_r_e_n_c_e_s:

     Venables, W. N. and Ripley, B. D. (2002) _Modern Applied
     Statistics with S._ Fourth edition.  Springer.

_E_x_a_m_p_l_e_s:

     require(lattice)
     xyplot(Gas ~ Temp | Insul, whiteside, panel =
       function(x, y, ...) {
         panel.xyplot(x, y, ...)
         panel.lmline(x, y, ...)
       }, xlab = "Average external temperature (deg. C)",
       ylab = "Gas consumption  (1000 cubic feet)", aspect = "xy",
       strip = function(...) strip.default(..., style = 1))

     gasB <- lm(Gas ~ Temp, whiteside, subset = Insul=="Before")
     gasA <- update(gasB, subset = Insul=="After")
     summary(gasB)
     summary(gasA)
     gasBA <- lm(Gas ~ Insul/Temp - 1, whiteside)
     summary(gasBA)

     gasQ <- lm(Gas ~ Insul/(Temp + I(Temp^2)) - 1, whiteside)
     summary(gasQ)$coef

     gasPR <- lm(Gas ~ Insul + Temp, whiteside)
     anova(gasPR, gasBA)
     options(contrasts = c("contr.treatment", "contr.poly"))
     gasBA1 <- lm(Gas ~ Insul*Temp, whiteside)
     summary(gasBA1)$coef

