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)

Arguments

N

Sample size (number of subjects).

lambda0

Baseline hazard scale parameter (λ).

rho

Baseline hazard shape parameter (ρ).

lp

Linear predictor, typically a linear combination of covariates and their coefficients.

Value

A survival object representing the simulated event times with mild censoring.

See also

Other generate: generate_X(), generate_lp(), generate_y()

Examples

# 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)