Question

Suppose you are to simulate a survival data with event time T following an exponential distribution...

Suppose you are to simulate a survival data with event time T following an exponential distribution with a mean of 42, and cnesoring time C following an exponential distribution with a mean of 18. For the simulated data, what is the expected percent of censored cases?

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Run the code below in R Studio:

 set.seed(1001); n = 100000; T = rexp(n , rate = 1/42); C = rexp(n , rate = 1/18); prop = C/T; prop = prop[prop <= 1]; mean(prop)

Output:

> set.seed(1001) > n = 100000 > T = rexp(n , rate = 1/42) > C = rexpcn , rate = 1/18) > prop - C/T > prop = prop[prop <= 1] >

Here we used to simulate the percent of censcored cases. Since censoring time should be less than event time, we exclude the cases where T > C and the expected value is estimated as 0.3090527

Add a comment
Know the answer?
Add Answer to:
Suppose you are to simulate a survival data with event time T following an exponential distribution...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT