generate_Weib.Rd
This function generates survival data using a Weibull baseline hazard. The event times are simulated based on a linear predictor and mild censoring is applied to the data.
generate_Weib(N, lambda0, rho, lp)
A survival object representing the simulated event times with mild censoring.
Other generate:
generate_X()
,
generate_lp()
,
generate_y()
# Simulate 10 Gaussian covariate predictors:
X <- generate_X(n = 100, p = 10, p_b = 0, cov_type = "cov_equi", rho = 0.2)
# Create linear predictor with first 5 beta-coefficients = 1 (all other zero)
lp <- generate_lp(X, p_nn = 5, a = 1)
# Simulate from Weibull hazard with baseline hazard h0(t) = λ * ρ * t^(ρ-1)
# and linear predictor, whose first 3 coefficients are non-zero:
y <- generate_Weib(N = nrow(X), lambda0 = 0.01, rho = 1, lp = lp)