Laura:  I think you need to include an interaction of Year + newWater
(i.e., Year:newWater) if you want trends across Year to be able to differ
by newWater categories (the common regression modeling approach of allowing
separate slopes and intercepts among different categorical groups in a
common model).  As you currently have your model parameterized, only the
intercept terms are able to differ among newWater categories (of course,
this assumes that you have newWater in as a design contrast among
categorical factor levels).

Brian

Brian S. Cade, PhD

U. S. Geological Survey
Fort Collins Science Center
2150 Centre Ave., Bldg. C
Fort Collins, CO  80526-8818

email:  [email protected] <[email protected]>
tel:  970 226-9326



On Thu, Jul 3, 2014 at 2:17 PM, Lee, Laura <[email protected]> wrote:

> 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
>
> _______________________________________________
> R-sig-ecology mailing list
> [email protected]
> https://stat.ethz.ch/mailman/listinfo/r-sig-ecology
>

        [[alternative HTML version deleted]]

_______________________________________________
R-sig-ecology mailing list
[email protected]
https://stat.ethz.ch/mailman/listinfo/r-sig-ecology

Reply via email to