Learn R Programming

CNprep (version 1.0)

getz:

Usage

getz(logr, emfit, zgroup, times)

Arguments

logr
emfit
zgroup
times

Value

    Examples

    Run this code
    ##---- Should be DIRECTLY executable !! ----
    ##-- ==>  Define data, use random,
    ##--	or do  help(data=index)  for the standard data sets.
    
    ## The function is currently defined as
    function (logr, emfit, zgroup, times) 
    {
        gz <- predict(emfit, newdata = logr)$z
        gz[is.nan(gz)] <- 0
        gz <- gz %*% t(zgroup)
        gz <- matrix(ncol = ncol(gz), data = apply(gz, 2, cumsum)[seq(from = times, 
            to = nrow(gz), by = times), ]/times)
        return(gz - rbind(matrix(nrow = 1, data = rep(0, ncol(gz))), 
            matrix(ncol = ncol(gz), data = gz[-nrow(gz), ])))
      }

    Run the code above in your browser using DataLab