Hi, I need to get mean and variance of right censored data. How can I do that? I have a vector of values (called a) and vector of booleans (whether value is censored) (called b). What to do with this? Sorry, I'm R beginner. Thank you! Pete
No, it doesn't. Right-censored data are data with (so-called) censored values. E.g. there is a newsvendor and he sells newspapers for a week. Mon: 77 Tue: 56 Wed: 60 Thu: 80 Fri: 85 Sat: 59 Sun: 48 This values are numbers of sold pieces from Monday to Sunday. And he sold out newspapers on Wednesday and on Thursday. This is an example of right-censored data. He could sold more pieces in that two days. And I need the variance and mean of data like this. Thank you! On Sun, 24 Jul 2005, jim holtman wrote:> does > > mean(a[b]) > var(a[b]) > > do what you want? This selects just those values of 'a' that are TRUE in 'b'. > > On 7/24/05, Petr Mandys <petr.mandys at matfyz.cz> wrote: >> Hi, >> >> I need to get mean and variance of right censored data. How can I do that? >> >> I have a vector of values (called a) and vector of booleans (whether value >> is censored) (called b). What to do with this? Sorry, I'm R beginner. >> >> Thank you! >> >> Pete >> >> ______________________________________________ >> R-help at stat.math.ethz.ch mailing list >> https://stat.ethz.ch/mailman/listinfo/r-help >> PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html >> > > > -- > Jim Holtman > > What the problem you are trying to solve? >
The survival package has functions for fitting models to right censored data. require(survival) ?survfit ?Surv -Don At 12:17 AM +0200 7/25/05, Petr Mandys wrote:>Hi, > >I need to get mean and variance of right censored data. How can I do that? > >I have a vector of values (called a) and vector of booleans (whether value >is censored) (called b). What to do with this? Sorry, I'm R beginner. > >Thank you! > >Pete > >______________________________________________ >R-help at stat.math.ethz.ch mailing list >https://stat.ethz.ch/mailman/listinfo/r-help >PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html-- -------------------------------------- Don MacQueen Environmental Protection Department Lawrence Livermore National Laboratory Livermore, CA, USA
Seemingly Similar Threads
- MLE for right-censored data with covariates
- How to generate a random variate that is correlated with a given right-censored random variate?
- Parametric survival models with left truncated, right censored data
- Fitting mean and covariance of Multivariate normal with censored data
- survdiff for Left-truncated and right-censored data