frogs                  package:DAAG                  R Documentation

_F_r_o_g_s _D_a_t_a

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

     The 'frogs' data frame has 212 rows and 11 columns. The data are
     on the distribution of the Southern Corroboree frog, which occurs
     in the Snowy Mountains area of New South Wales, Australia.

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

     frogs

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

     This data frame contains the following columns:

     _p_r_e_s._a_b_s 0 = frogs were absent, 1 = frogs were present

     _n_o_r_t_h_i_n_g reference point

     _e_a_s_t_i_n_g reference point

     _a_l_t_i_t_u_d_e altitude , in meters

     _d_i_s_t_a_n_c_e distance in meters to nearest extant population

     _N_o_O_f_P_o_o_l_s number of potential breeding pools

     _N_o_O_f_S_i_t_e_s (number of potential breeding sites within a 2 km 
          radius

     _a_v_r_a_i_n mean rainfall for Spring period

     _m_e_a_n_m_i_n mean minimum Spring temperature

     _m_e_a_n_m_a_x mean maximum Spring temperature

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

     Hunter, D. (2000) The conservation and demography of  the southern
     corroboree frog (Pseudophryne corroboree). M.Sc. thesis,
     University of Canberra, Canberra.

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

     print("Multiple Logistic Regression - Example 8.2")

     plot(northing ~ easting, data=frogs, pch=c(1,16)[frogs$pres.abs+1],
       xlab="Meters east of reference point", ylab="Meters north")

     pause()

     oldpar <- par(oma=c(2,2,2,2), cex=0.5)
     pairs(frogs[,4:10])
     par(oldpar)

     pause()

     oldpar <- par(mfrow=c(1,3))
     for(nam in c("distance","NoOfPools","NoOfSites")){
       y <- frogs[,nam]
       plot(density(y),main="",xlab=nam)
     par(oldpar)
     }

     pause()

     attach(frogs)
     pairs(cbind(altitude,log(distance),log(NoOfPools),NoOfSites),
       panel=panel.smooth, labels=c("altitude","log(distance)",
       "log(NoOfPools)","NoOfSites"))
     detach(frogs)

     frogs.glm0 <- glm(formula = pres.abs ~ altitude + log(distance) +
       log(NoOfPools) + NoOfSites + avrain + meanmin + meanmax,
       family = binomial, data = frogs)
     summary(frogs.glm0)
     pause()

     frogs.glm <- glm(formula = pres.abs ~ log(distance) + log(NoOfPools) + 
     meanmin +
       meanmax, family = binomial, data = frogs)
     oldpar <- par(mfrow=c(2,2))
     termplot(frogs.glm, data=frogs)
     par(oldpar)
     pause()

     termplot(frogs.glm, data=frogs, partial.resid=TRUE)

     cv.binary(frogs.glm0)   # All explanatory variables
     pause()

     cv.binary(frogs.glm)    # Reduced set of explanatory variables

     pause()

     for (j in 1:4){
      rand <- sample(1:10, 212, replace=TRUE)
      all.acc <- cv.binary(frogs.glm0, rand=rand, print.details=FALSE)$acc.cv
      reduced.acc <- cv.binary(frogs.glm, rand=rand, print.details=FALSE)$acc.cv
      cat("\nAll:", round(all.acc,3), "  Reduced:", round(reduced.acc,3))
     }

