Page 1 of 1

change factor level represented by intercept

PostPosted: Tue Oct 18, 2011 5:14 pm
by abreton
From the MARK book, Appendix C, page C-14:
The design matrix is created using the convention called treatment contrasts. That means the first level is used as the intercept and the parameters for the remaining levels are an additive amount relative to the intercept.


Given sparse data, I've found that it helps to specify a relatively data-rich level of a factor variable as the intercept. For example, consider year as a factor variable with seven levels, 2004-2010. In MARK I've specified the DM so that the intercept represents 2010, 2004-2009 are offsets. In contrast, RMARK (for reasons in quote above) defaults to the first group, 2004, to be represented by the intercept.

It is possible to change the factor level represented by intercept in RMARK? I considered sorting my MARK.inp file so 2010 was the first group in the data file, but it seems that at the process.data stage of RMARK the data are re-sorted ascending by groups (which would undo my ad hoc fix).

This flexibility would also allow me to more efficiently compare my results between RMARK and MARK...I suspect I'm not done making mistakes in RMARK just yet!!

Thanks for any input.

andre

Re: change factor level represented by intercept

PostPosted: Tue Oct 18, 2011 5:19 pm
by jlaake
See the relevel function in R. It will let you set which factor level is considered first. See the examples on pg 6 and 59 of the RMark Workshop notes.

--jeff

Re: change factor level represented by intercept

PostPosted: Tue Oct 18, 2011 7:11 pm
by abreton
A generous response given that the answer was on page 6 in plain English! I'll make better use of this document in the future, thanks Jeff...'relevel' did the trick. - andre