6
$\begingroup$

I need to fit $Y_{ij} \sim NegBin(m_{ij},k)$, i.e. a negative binomial distribution to count data. However, the data I have observed are censored - I know the value of $y_{ij}$, but it could be more than that value. The log-likelihood is

\begin{equation} ll = \sum_{i=1}^n w_i (c_i \log(P(Y_{ij}=y_{ij}|X_{ij})) + (1- c_i) \log(1- \sum_{k=1}^32 P(Y_{ij} = k|X_{ij}))) \end{equation}

where $X_{ij}$ represent the design matrix (with the covariates of interest), $w_i$ is the weight for each observation, $y_{ij}$ is the response variable and $P(Y_{ij}=y_{ij}|X_{ij})$ is the negative binomial distribution where the $m_{ij}=exp(X_{ij} \beta)$ and $\alpha$ is the over-dispersion parameter.

Does anyone know of an R package to tackle this problem?

$\endgroup$
2
  • 1
    $\begingroup$ I hope I did not mangle the eqns while converting them to latex. You can use latex on this site. See: meta.stats.stackexchange.com/questions/218/… Could you also please clean up the question a bit. For example, the first line is a bit odd, what do you mean by " I know the value of $y_{ij}$, but it could be more than that value." etc. $\endgroup$
    – user28
    Aug 13 '10 at 14:32
  • $\begingroup$ I don't know of an R procedure that would do it, however there is a Stata module CENSORNB that does exactly this. Perhaps looking at the code might give you ideas. $\endgroup$
    – Aniko
    Aug 13 '10 at 19:23
2
$\begingroup$

You can try gamlss.cens package.

$\endgroup$
2
$\begingroup$

Another R package that seems to do what you want, is pscal. The associated vignette has lots of examples.

$\endgroup$
1
  • $\begingroup$ Didn't know pscal handled classical NB models (besides zero inflated and hurdle). Thanks. $\endgroup$
    – ars
    Aug 17 '10 at 17:45