hills                  package:DAAG                  R Documentation

_S_c_o_t_t_i_s_h _H_i_l_l _R_a_c_e_s _D_a_t_a

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

     The record times in 1984 for 35 Scottish hill races.

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

     hills

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

     This data frame contains the following columns:

     _d_i_s_t distance, in miles (on the map)

     _c_l_i_m_b total height gained during the route, in feet

     _t_i_m_e record time in hours

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

     A.C. Atkinson (1986) Comment: Aspects of diagnostic regression
     analysis. Statistical Science  1, 397-402.

     Also, in MASS library, with time in minutes.

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

     A.C. Atkinson (1988) Transformations unmasked. Technometrics 30,
     311-318. [ "corrects" the time for Knock Hill from 78.65 to 18.65.
     It    is unclear if this based on the original records.]

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

     print("Transformation - Example 6.4.3")
     pairs(hills, labels=c("dist\n\n(miles)", "climb\n\n(feet)", 
     "time\n\n(hours)"))
     pause()

     pairs(log(hills), labels=c("dist\n\n(log(miles))", "climb\n\n(log(feet))",
       "time\n\n(log(hours))"))
     pause()

     hills0.loglm <- lm(log(time) ~ log(dist) + log(climb), data = hills)  
     oldpar <- par(mfrow=c(2,2))
     plot(hills0.loglm)
     pause()

     hills.loglm <- lm(log(time) ~ log(dist) + log(climb), data = hills[-18,])
     summary(hills.loglm) 
     plot(hills.loglm)
     pause()

     hills2.loglm <- lm(log(time) ~ log(dist)+log(climb)+log(dist):log(climb), 
     data=hills[-18,])
     anova(hills.loglm, hills2.loglm)
     pause()

     step(hills2.loglm)
     pause()

     summary(hills.loglm, corr=TRUE)$coef
     pause()

     summary(hills2.loglm, corr=TRUE)$coef
     par(oldpar)
     pause()

     print("Nonlinear - Example 6.9.4")
     hills.nls0 <- nls(time ~ (dist^alpha)*(climb^beta), start =
        c(alpha = .909, beta = .260), data = hills[-18,])
     summary(hills.nls0)
     plot(residuals(hills.nls0) ~ predict(hills.nls0)) # residual plot
     pause()

     hills$climb.mi <- hills$climb/5280
     hills.nls <- nls(time ~ alpha + beta*dist + gamma*(climb.mi^delta),
       start=c(alpha = 1, beta = 1, gamma = 1, delta = 1), data=hills[-18,])
     summary(hills.nls)
     plot(residuals(hills.nls) ~ predict(hills.nls)) # residual plot

