Message-ID: <2789D349964A854E9524A3CD0D759E0436F0489E@NCWWDITMXMBX35.ad.ncmail>
Date: 2014-07-03T20:17:05Z
From: Lee, Laura
Subject: help with censored regression model
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