R/indexDummy.r

Defines functions indexDummy

Documented in indexDummy

indexDummy <- function(kj, f, p){

# compute the column numbers for the dummy variables for each
# factor (for each factor, the output list contains a vector
# consisting of the column indices)

c <- p - f
JJs <- list()
JJs[[1]] <- c + 1:(kj[1] - 1)

if (f > 1){
for (j in 2:f){
        JJs[[j]] <- max(JJs[[j - 1]]) + 1:(kj[j] - 1)
}}

return(JJs)
}

Try the OrdFacReg package in your browser

Any scripts or data that you put into this service are public.

OrdFacReg documentation built on May 1, 2019, 10:06 p.m.