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:

     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)
     coef(summary(gasQ))

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

