Ravi Varadhan
2011-Aug-26 18:56 UTC
[R] How to generate a random variate that is correlated with a given right-censored random variate?
Hi, I have a right-censored (positive) random variable (e.g. failure times subject to right censoring) that is observed for N subjects: Y_i, I = 1, 2, ..., N. Note that Y_i = min(T_i, C_i), where T_i is the true failure time and C_i is the censored time. Let us assume that C_i is independent of T_i. Now, I would like to generate another random variable U_i, I = 1, 2, ..., N, which is correlated with T. In other words, I would like to generate U from the conditional distribution [U | T=t]. One approach might be to assume that the joint distn [T, U] is bivariate lognormal. So, the marginals [T] and [U], as well as the conditional [U | T] are also lognormal. I can estimate the marginal [T] using the right-censored data Y (assuming independent censoring). For example, I might use survival::survreg to do this. Then, I assume that U is standard lognormal (mean = 0, var = 1). Now, I only need to assume a value for correlation parameter, r, and I can then sample from the conditional [U | T=t] which is also a lognormal (parametrized by r). Does this sound right? Are there better/simpler ways to do this? Thanks very much for any hints. Best, Ravi. ------------------------------------------------------- Ravi Varadhan, Ph.D. Assistant Professor, Division of Geriatric Medicine and Gerontology School of Medicine Johns Hopkins University Ph. (410) 502-2619 email: rvaradhan@jhmi.edu<mailto:rvaradhan@jhmi.edu> [[alternative HTML version deleted]]
Ravi Varadhan
2011-Aug-26 20:45 UTC
[R] How to generate a random variate that is correlated with a given right-censored random variate?
Hi, Here is an update. I implemented this bivariate lognormal approach. It works well in simulations when I generated the marginal [T] from a lognormal distribution and independently censored it. It, however, does not do well when I generate from a marginal [T] that is Weibull or a distribution not well approximated by a lognormal. How to make the approach more robust to distributional assumptions on the marginal of [T]? I am thinking that a bivariate copula approach is called for. The [U] margin can be standard lognormal as before, and the [T] margin needs to be a flexible distribution. What kind of bivariate coupla might work? Then, how to generate from the conditional distribution [U | T]? Any thoughts? Thanks, Ravi. ------------------------------------------------------- Ravi Varadhan, Ph.D. Assistant Professor, Division of Geriatric Medicine and Gerontology School of Medicine Johns Hopkins University Ph. (410) 502-2619 email: rvaradhan@jhmi.edu<mailto:rvaradhan@jhmi.edu> From: Ravi Varadhan Sent: Friday, August 26, 2011 2:56 PM To: r-help@r-project.org Subject: How to generate a random variate that is correlated with a given right-censored random variate? Hi, I have a right-censored (positive) random variable (e.g. failure times subject to right censoring) that is observed for N subjects: Y_i, I = 1, 2, ..., N. Note that Y_i = min(T_i, C_i), where T_i is the true failure time and C_i is the censored time. Let us assume that C_i is independent of T_i. Now, I would like to generate another random variable U_i, I = 1, 2, ..., N, which is correlated with T. In other words, I would like to generate U from the conditional distribution [U | T=t]. One approach might be to assume that the joint distn [T, U] is bivariate lognormal. So, the marginals [T] and [U], as well as the conditional [U | T] are also lognormal. I can estimate the marginal [T] using the right-censored data Y (assuming independent censoring). For example, I might use survival::survreg to do this. Then, I assume that U is standard lognormal (mean = 0, var = 1). Now, I only need to assume a value for correlation parameter, r, and I can then sample from the conditional [U | T=t] which is also a lognormal (parametrized by r). Does this sound right? Are there better/simpler ways to do this? Thanks very much for any hints. Best, Ravi. ------------------------------------------------------- Ravi Varadhan, Ph.D. Assistant Professor, Division of Geriatric Medicine and Gerontology School of Medicine Johns Hopkins University Ph. (410) 502-2619 email: rvaradhan@jhmi.edu<mailto:rvaradhan@jhmi.edu> [[alternative HTML version deleted]]
Dimitris Rizopoulos
2011-Aug-27 05:25 UTC
[R] How to generate a random variate that is correlated with a given right-censored random variate?
Perhaps it could help if you could assume a more flexible model for [T]; for instance, a PH model with a piecewise-constant baseline hazard, which you can simulate as a Poisson variable. Best, Dimitris On 8/26/2011 10:45 PM, Ravi Varadhan wrote:> Hi, > > Here is an update. I implemented this bivariate lognormal approach. It works well in simulations when I generated the marginal [T] from a lognormal distribution and independently censored it. It, however, does not do well when I generate from a marginal [T] that is Weibull or a distribution not well approximated by a lognormal. How to make the approach more robust to distributional assumptions on the marginal of [T]? > > I am thinking that a bivariate copula approach is called for. The [U] margin can be standard lognormal as before, and the [T] margin needs to be a flexible distribution. What kind of bivariate coupla might work? Then, how to generate from the conditional distribution [U | T]? Any thoughts? > > Thanks, > Ravi. > ------------------------------------------------------- > Ravi Varadhan, Ph.D. > Assistant Professor, > Division of Geriatric Medicine and Gerontology School of Medicine Johns Hopkins University > > Ph. (410) 502-2619 > email: rvaradhan at jhmi.edu<mailto:rvaradhan at jhmi.edu> > > From: Ravi Varadhan > Sent: Friday, August 26, 2011 2:56 PM > To: r-help at r-project.org > Subject: How to generate a random variate that is correlated with a given right-censored random variate? > > Hi, > > I have a right-censored (positive) random variable (e.g. failure times subject to right censoring) that is observed for N subjects: Y_i, I = 1, 2, ..., N. Note that Y_i = min(T_i, C_i), where T_i is the true failure time and C_i is the censored time. Let us assume that C_i is independent of T_i. Now, I would like to generate another random variable U_i, I = 1, 2, ..., N, which is correlated with T. In other words, I would like to generate U from the conditional distribution [U | T=t]. > > One approach might be to assume that the joint distn [T, U] is bivariate lognormal. So, the marginals [T] and [U], as well as the conditional [U | T] are also lognormal. I can estimate the marginal [T] using the right-censored data Y (assuming independent censoring). For example, I might use survival::survreg to do this. Then, I assume that U is standard lognormal (mean = 0, var = 1). Now, I only need to assume a value for correlation parameter, r, and I can then sample from the conditional [U | T=t] which is also a lognormal (parametrized by r). > > Does this sound right? Are there better/simpler ways to do this? > > Thanks very much for any hints. > > Best, > Ravi. > ------------------------------------------------------- > Ravi Varadhan, Ph.D. > Assistant Professor, > Division of Geriatric Medicine and Gerontology School of Medicine Johns Hopkins University > > Ph. (410) 502-2619 > email: rvaradhan at jhmi.edu<mailto:rvaradhan at jhmi.edu> > > > [[alternative HTML version deleted]] > > ______________________________________________ > R-help at r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. >-- Dimitris Rizopoulos Assistant Professor Department of Biostatistics Erasmus University Medical Center Address: PO Box 2040, 3000 CA Rotterdam, the Netherlands Tel: +31/(0)10/7043478 Fax: +31/(0)10/7043014 Web: http://www.erasmusmc.nl/biostatistiek/