TABLE OF CONTENTS


simulation/generatecovariate [ Functions ]

NAME

    generatecovariate --- generate simulated covariates

FUNCTION

Generates a single covariate, Normal with a given mean and variance. Old code to generate multiple covariates or time - dependent covariates has been removed.

SYNOPSIS

576 generatecovariate <- function(params)

SOURCE

579 {
580     m <- params$m;Ji <- params$Ji;timedep <- params$timedep
581     Z1mean <- params$Z1mean;Z1var <- params$Z1var
582     gamweib <- params$gamweib;lambda0 <- params$lambda0;
583     if(timedep){
584         Zij1 <- rnorm(sum(Ji) * 100, Z1mean, Z1var);dim(Zij1) <- c(sum(Ji), 100)
585         Zij1times <- rweibull(sum(Ji) * 100, shape = gamweib,
586             scale = lambda0^(-1 / gamweib));dim(Zij1times) <- c(sum(Ji), 100)
587         return(list(Zij1 = Zij1, Zij1times = Zij1times))
588     }else{
589         Zij1 <- rnorm(sum(Ji), Z1mean, Z1var)
590         return(Zij1)
591     }
592 }