0
$\begingroup$

I'm analyzing environmental data using the "NADA" R library, which relies heavily on the "survival" package.
I am dealing with left-censored data, which are nonetheless strictly positive. To deal with the positiveness I'm using a "lognormal" distribution.
As I need to use the developed model in another software I need to be able to do predictions without using the predict command. In order to do that I'm using the following pseudo-formula (where Y is the prediction, X are the predictions and intercept, coeff and scale come from the model outcome):

Y=10^(intercept+sum(coeff*X)+scale*qlnorm(0.5))

The Y value is different from the outcome of the predict command using the same Xs.
What am I doing wrong?
Thanks

EDIT: I found that the prediction is calculated, for the quantile of interest, using:

Y=exp(intercept+sum(coef*X)+scale*qnorm(quantile))

How is it possible to take into account also the standard error in the parameters estimates?
Thanks

$\endgroup$
  • $\begingroup$ What is lnorm()? $\endgroup$ – alan ocallaghan Feb 10 at 11:05
  • 1
    $\begingroup$ qlnorm(p) is the quantile of a lognormal distribution with meanlog=0 and sdlog=1 and p is the percentile. I edited the question since the q was missing $\endgroup$ – Mabri Feb 10 at 11:12
  • $\begingroup$ I'm using qlnorm. The typo was just here, not in the actual code $\endgroup$ – Mabri Feb 10 at 11:14
  • $\begingroup$ Yes sorry! I didn't realise you'd already edited the question :) $\endgroup$ – alan ocallaghan Feb 10 at 11:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.