set.seed(1997)
# Generate covariates and true parameter values
n <- 500
x <- cbind(1, rnorm(n))
beta <- c(2, -1)
sigma2 <- 1
lambda <- 3
nu <- 3
# Generate a simulated dataset under SMSN-ICR model, with interval censoring and/or missing values
sample <- gen_SMSNCens_sample(n = n, x = x, beta = beta, sigma2 = sigma2,
lambda = lambda, nu = nu, cens = "Int",
pcens = 0.1, pna = 0.05, family = "ST")
# Fit the SMSN-ICR model using the generated data
fit <- CensRegSMSN(sample$cc, x, sample$yc, cens = "Int", UL = sample$UL, get.init = TRUE,
show.envelope = TRUE, family = "ST")
Run the code above in your browser using DataLab