Sdata                package:grouped                R Documentation

_S_i_m_u_l_a_t_e_d _D_a_t_a

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

     A simulated data-set used for the illustration of 'grouped' for
     grouped data  coming from a logit-normal distribution.

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

     A data frame with 250 observations on the following 4 variables:

     '_l_o' the lower limits of the response intervals.

     '_u_p' the upper limits of the response intervals.

     '_t_r_e_a_t' the treatment indicator.

     '_x' a continuous covariate.

_D_e_t_a_i_l_s:

     The data set has been produced with the code in the *Examples*
     below.

_A_u_t_h_o_r(_s):

     Dimitris Rizopoulos dimitris.rizopoulos@med.kuleuven.be

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

     ## Not run: 
     n <- 250
     treat <- rbinom(n, 1, 0.5)
     x <- runif(n, -4, 4)
     mu <- 1 + 0.5 * treat -1 * x + 0.8 * treat * x
     u <- plogis(rnorm(n, mu, 2))

     index <- cbind(c(0, 0.25, 0.5, 0.75), c(0.25, 0.5, 0.75, 1)) 
     a <- b <- numeric(n)
     for(i in 1:n){
         ind <- which(index[, 2] - u[i] > 0)[1]
         a[i] <- index[ind, 1]
         b[i] <- index[ind, 2]
     }
     Sdata <- data.frame(lo = a, up = b, treat = factor(treat), x)
     ## End(Not run)

     str(Sdata)
     summary(Sdata)

