Squared term in nesting success

Forum for discussion of general questions related to study design and/or analysis of existing data - software neutral.

Squared term in nesting success

Postby cgres » Thu May 26, 2016 9:40 pm

Hi everyone!

I am analyzing nesting success (almost successfully) as you can see in my last post:
viewtopic.php?f=21&t=3284

My set of models from the old post worked perfect, including the full model:
rLD+yr+yr2+rLD:yr+rLD:yr2+NestAge

where
rLD = relative laying date
yr = year
NestAge= nest age
yr2= year squared term (yr^2) to look for non-linearity
and the interactions between rLD:yr and rLD:yr2

However I was asked to include also models where I use relative laying date with a squared term (rLD^2) instead of rLD, also to look for non-linear effect in the season. This is not working anymore. I found that the models that have a problem are those including both interactions when using the rLD^2:

rLD2+yr+yr2+rLD2:yr+rLD2:yr2+NestAge
and
rLD2+yr+yr2+rLD2:yr+rLD2:yr2

the reason to have this model including rLD^2 is because the nesting success - laying date (rLD) relationship for every year is non-linear and we want to look for systematic changes over time in this relationship.

Can you please give me some advice?
cgres
 
Posts: 6
Joined: Wed Jan 27, 2016 6:51 pm

Re: Squared term in nesting success

Postby jlaake » Tue May 31, 2016 10:19 am

Any time you are posting a message with an R formula, you should probably be posting in the RMark sub-forum. Only a guess but you may want to include linear rLD as well. An alternative is to use library(splines) and use bs(rLD) in the formula to fit a cubic spline.
jlaake
 
Posts: 1417
Joined: Fri May 12, 2006 12:50 pm
Location: Escondido, CA


Return to analysis & design questions

Who is online

Users browsing this forum: No registered users and 12 guests