[R] Error with stepwise models selection using NADA library

Marco Gabrielli m@rco@g@br|e|||94 @end|ng |rom gm@||@com
Fri Mar 6 11:05:05 CET 2020


Hi,
I'm working with environmental data which are left-censored and I found the
R package NADA which seems to do the job.
After fitting a complete model, using the cenreg function,I'd like to do a
stepwise procedure to minimize the AIC using the stepAIC function.
Unfortunately, after fitting the model, the stepAIC does not work with
either the cenreg object or the S3 survreg object within.

Here it is an example of the commands used:

library(NADA)
MLEtot=with(df, cenreg(Cen(Y,Cen)~x1+x2+x3+x4,dist="lognormal"))
stepAIC(MLEtot)
"Error: $ operator not defined for this S4 class"
stepAIC(MLEtot using survreg)
"Start:  AIC=6.16
asSurv(Cen(Y, Cen)) ~ x1 + x2 + x3 + x4
Error in (function (classes, fdef, mtable)  :
   unable to find an inherited method for function ‘asSurv’ for signature
‘"Surv"’"

How can I do manage to make it work?
Thanks



More information about the R-help mailing list