|
|
Rob Knell :R functions for analysing non-linear allometry |
|
|
Last updated 27th March 2008 |
||
|
Biological Sciences |
||
This page has code for some analyses in R that can be used for non-linear allometries. They are more or less explained in Knell, R.J. (2008) On the analysis of non-linear allometries, Ecological Entomology in press.These are given as text files, and to use them in R the text needs to be cut-and-pasted into the R console window.
This uses the numerical method from Eberhard and Gutierrez (1990) to calculated switchpoints in continuous and discontinuous allometric data. The version here was originally coded by Ken Wilson (Lancaster University) for S-Plus, and has been converted for R and substantially revised by me. Note that there are problems with this analysis giving the wrong df in an F-test and an incorrect AIC score because an "extra" parameter (the switchpoint) is calculated (see Knell 2008, Ecological Entomology, in press for details). This piece of code gives an AIC score that is corrected for this.
Download the function as a text file here.
This calculates bootstrap 95% confidence intervals for the difference between two switchpoints, enabliong a statistical test of whether switchpoints differ between two populations or species (again, see Knell 2008, Ecological Entomology, in press for details). If the 95% CIs do not include zero, then there is a significant difference. Note that this function will only work if Switchpoint.fun2 has been loaded into R.
Download the function as a text file here.
Code for simulating a wide range of datasets that are more or less dimorphic, and with more or less overlap in X and Y between the morphs.