TABLE OF CONTENTS


utility/makeUijframe [ Functions ]

NAME

    makeUijFrame --- Make Uijmat and Vijmat matrices

FUNCTION

Convert vectors of frailties into matrices in order to make them addressable as U[i, j]

SYNOPSIS

163 makeUijframe <- function(m, Ji, Uij, Vij)

INPUTS

    m      number of clusters
    Ji     cluster sizes
    Uij    vector of length m * Ji containing frailties for event 1
    Vij    vector of length m * Ji containing frailties for event 2

OUTPUTS

    Uijmat     matrix of dimension m x max(Ji) containing entries of Uij
    Vijmat     matrix of dimension m x max(Ji) containing entries of Vij

SOURCE

166 {
167     # Allocate matrix storage
168     Uijmat <- matrix(0, m, max(Ji))
169     Vijmat <- matrix(0, m, max(Ji))
170     # Fill matrices row by row
171     for(i in 1:m){
172         Uijmat[i, 1:Ji[i]] <- Uij[(c(0, cumsum(Ji))[i] + 1):(c(0, cumsum(Ji))[i + 1])]
173         Vijmat[i, 1:Ji[i]] <- Vij[(c(0, cumsum(Ji))[i] + 1):(c(0, cumsum(Ji))[i + 1])]
174     }
175     return(list(Uijmat = Uijmat, Vijmat = Vijmat))
176 }