[R-sig-eco] help with censored regression model

Lee, Laura laura.lee at ncdenr.gov
Thu Jul 3 22:17:05 CEST 2014


Hello all!

I am trying to model censored catch-per-unit-effort (CPUE) data. The data are censored by trip limits that vary by year. I am using the 'gamlss' and 'survival' packages. My model covariates are Year and newWater. I need to get annual trends in CPUE by waterbody (newWater). After running the model and computing the index, I find the trends are the same among all water bodies--the magnitude is slightly different. I would not expect the trends to be the same among the different areas. I would appreciate any assistance. Code is below.

cy <- with(data, ifelse(NUMBERS>=Limit, Limit, NUMBERS))
ci <- with(data, ifelse(NUMBERS>=Limit, 0, 1))
data <- data.frame(data, cy, ci)
rm(cy,ci)
gen.cens("LOGNO",type="right")
cfit <- gamlss(Surv(cy, ci) ~ YEAR + newWater, data=data, family=LOGNOrc)
data$y <- exp(fitted(cfit))
out <- with(data, tapply(y, list(YEAR,newWater), mean))

Thanks again for your help,

Laura



More information about the R-sig-ecology mailing list