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@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

______________________________________________
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to