0
$\begingroup$

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?

$\endgroup$
0
$\begingroup$

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.

At first, you can generate a dataset with all of covariates according to your plan. For example you want 1000 people, half of them are men, and the ages follow normal with mean 45 and standard deviation 15,.... Next, generate a new variable lambda derived from covariates for each person. Last thing is generating the random number following the exponential distribution with given lambda.

$\endgroup$
  • $\begingroup$ Thank u very much @user158565 for your explanation, I understand what you're trying to say. But, I have another question regarding your answer. In order to generate a new variable lambda derived from covariates for each person, do we need to derived it directly from the covariate PDF (eg. N(45,15^2) for ages)? If yes, which parameter of the Normal dist will become the lambda? Or, do we need to perform the linear combination of all covariates (if we have more than 1 covariate). $\endgroup$ – doyang2 Nov 26 '18 at 5:42
  • $\begingroup$ First, select a person with specified covariate values as reference, for example, male, age = 40, ..., and think about his mean survival time, the inverse of it is the lambda for this person. Then following your idea to adjust the lambda according to covariate values. for example. for female, the survival time will be longer, then minus a value from reference lambda. ... $\endgroup$ – user158565 Nov 26 '18 at 5:49
  • $\begingroup$ So, what you're trying to say is, for each person, the value of the new lambda may be different from another person, depending on their covariates, isn't it? $\endgroup$ – doyang2 Nov 26 '18 at 12:07
  • $\begingroup$ Yes. Just like fit a model, each person has his hazard according to his values on covariates. $\endgroup$ – user158565 Nov 26 '18 at 14:23
  • $\begingroup$ Got it. Tqvm... $\endgroup$ – doyang2 Nov 28 '18 at 12:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.