# Generating survival times with covariates

I would like to generate the survival time from an exponential distribution via inverse transformed method. The thing is, how can we generate a survival time having the covariates (eg. age) affected on it?

The probability density function (pdf) of exponential distribution is $$f(x) = \lambda e^{-\lambda x}$$. So it has just one parameter $$\lambda$$. You want to generate the random values following exponential distribution with different $$\lambda$$ according to some covariates.