burkitt               package:splancs               R Documentation

_B_u_r_k_i_t_t'_s _l_y_m_p_h_o_m_a _i_n _U_g_a_n_d_a

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

     Locations of cases of Burkitt's lymphoma in the Western Nile
     district of Uganda 1960-1975. The time variable is recorded as the
     number of days starting from an origin of 1 Jan 1960. The examples
     given below show how the `chron()' function and derived time
     structures may be used to analyse the data in the time dimension.

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

     data(burkitt)

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

     The data is provided as a data table:

       x    numeric  grid eastings
       y    numeric  grid northings
       t    numeric  day number starting at 1/1/1960 of onset
       age  numeric  age of child patient

     as a points object `burpts' of `burkitt$x' and `burkitt$y'; and a
     point object of the area boundary `burbdy'.

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

     Williams, E. H. et al. 1978, - Bailey and Gatrell 1995, ch. 3.

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

     Bailey, T. C. and Gatrell, A. C. 1995, Interactive spatial data
     analysis. Longman, Harlow.

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

     data(burkitt)
     try.obj <- try(library(chron))
     if (!is.na(match("chron", try.obj))) {
     burdates <- chron(burkitt$t, out.format="y-m-d",
             origin=c(day=1, month=1, year=1960))
     froms <- seq.dates(chron("7/1/1960", origin=c(1,1,1960)),
             chron("7/1/1975", origin=c(1,1,1960)), "years")
     tos <- seq.dates(chron("9/30/1960", origin=c(1,1,1960)),
             chron("9/30/1975", origin=c(1,1,1960)), "years")
     burd <- density(burdates, bw=100)
     plot(chron(burd$x, origin=c(day=1, month=1, year=1960)), burd$y,
             type="n", xaxp=c(chron("1/1/1960", origin=c(1,1,1960)),
             chron("1/1/1976", origin=c(1,1,1960)),16), xlab="time",
     ylab="density")
     for (i in 1:length(tos)) polygon(c(froms[i], tos[i], tos[i], froms[i]),
             c(par("usr")[3], par("usr")[3], par("usr")[4], par("usr")[4]), 
             col="grey", border=NULL)
     lines(chron(burd$x, origin=c(day=1, month=1, year=1960)), burd$y,
             lwd=3, col="red")
     title("Density plot of Burkitt's lymphoma in West Nile district, 3Q grey shaded")
     op <- par(mfrow=c(3,5))
     for (i in 1961:1975) {
             polymap(burbdy)
             pointmap(burpts[which(years(burdates) == i),], add=T, pch=19)
             title(i)
     }
     par(op)
     op <- par(mfrow=c(2,2))
     for (i in 1:4) {
             polymap(burbdy)
             pointmap(burpts[which(codes(quarters(burdates)) == i),], add=T,
     pch=19)
             title(paste(i, "Q", sep=""))
     }
     par(op)
     op <- par(mfrow=c(3,4))
     for (i in 1:12) {
             polymap(burbdy)
             pointmap(burpts[which(codes(months(burdates)) == i),], add=T, pch=19)
             title(levels(months(burdates, F))[i])
     }
     par(op)
     }

