0

I'm trying to fit centile curves for a censored gamma distribution. The censoring goes well I think, but when trying to make the percentile curves, I get the following result:

Centile curves for gamma distribution censored at 100

I tried the following code to get this:

y <- c(35.00, 100.00, 100.00,   5.00,  40.00,  40.00,  80.00,  50.00,  40.00,  60.00,
 45.00, 100.00,  40.00,  15.00,  45.00,  40.00,  72.50,  50.00, 100.00,  35.00,
 100.00,  50.00,  60.00,  30.00,  50.00, 56.25,  70.00,  50.00,  75.00, 100.00,
 83.00, 100.00,  81.25,  40.00,  50.00,  40.00,  36.00,  40.00,  56.25,  25.00,
 100.00,  50.00,  67.00, 100.00,  70.00,  45.00,  50.00, 100.00,  50.00,  50.00,
 50.00,  30.00,  50.00,  62.50,  30.00,  55.00,  40.00,  40.00,  25.00,  45.00,
 20.00,  40.00, 100.00,  40.00,  50.00,  75.00, 100.00,  50.00,  40.00,  70.00,
 35.00, 100.00, 100.00,  80.00,  50.00)
x <- c(44, 58, 57, 67, 52, 41, 49, 41, 33, 42, 47, 61, 68, 57, 58, 42, 53, 57, 57, 49, 58, 42, 55, 34, 55, 52, 61, 66, 57, 53, 50, 48, 69, 66, 60, 65, 56, 47, 52, 36, 62, 63, 50, 61, 56, 46, 35, 65, 48, 65, 58, 65, 64, 58, 53, 63, 58, 54, 64, 40, 65, 50, 61, 57, 61, 48, 64, 56, 62, 56, 50, 66, 65, 64, 64)
ysurv <- Surv(y1, y1!=100, type="right")
gen.cens(GA, type = "right")

g0Cens <- gamlss(ysurv ~ x, 
                 sigma.fo = ~x,
                 nu.fo = ~ x,
                 family = GArc)
centiles(g0Cens, x)

Now my question is, how can I prevent the centile curves to go over the bound of 100 since the values are only realistic to be inbetween 0 and 100.

I appreciate all your time and help.

Brian Tompsett - 汤莱恩
  • 5,753
  • 72
  • 57
  • 129

1 Answers1

0

You say only y values from 0 to 100 are realistic. You appear to have y values at exactly 100.

Are these values exactly 100, or censored above 100 (i.e. >=100) ?

If the values are exactly 100, and values above 100 are impossible, then you have a truncated distribution and not censoring. One idea is to divide y by 100, and then the new y lies between zero and 1 (including 1). So you would need an inflated distribution on [0,1], see Section 9.3 (p187-199) of Rigby et al. (2019). Another idea is to use a truncated distribution above 100.

If you truly have censored y values above 100, then values above 100 are possible and so the centiles should go above 100 as they do.

Robert
  • 36
  • 2
  • Thank you for your comment Robert! Yes, in principle I would need a truncated distribution instead of a censored one since I only have values exactly at 100, but I wanted to censor the distribution instead of truncating it to put the mass of values >100 on top of the mass of 100 to create an extra peak at 100. However, I also came up with he idea of rescaling 0-100 to 0-1 and I"m now using a zero-one Beta inflated distribution, which seems to work fine :) – Wouter Smeets May 22 '23 at 20:32