frair_test: Test for evidence of type-II or type-III functional responses

Description Usage Arguments Details Value Author(s) References See Also Examples

View source: R/frair_test.R

Description

Implements the phenomenological test of type-II versus type-III functional responses described by Juliano (2001)

Usage

1
2
3
frair_test(formula, data)
## S3 method for class 'frtest'
print(x, ...)

Arguments

formula

A simple formula of the form y ~ x.

data

The dataframe containing x and y.

x

Output from frair_test.

...

Other items passed to the print method.

Details

This function wraps up an otherwise trivial test for type-II versus type-III functional responses in a format consistent with the FRAIR syntax. It can be considered 'phenomenological' inasmuch as it tells the user if a type-II or type-III response is preferred, but not what form that curve should take nor if it is sensible to fit such a curve via non-linear regression.

The test relies on the established principle that a logistic regression on the proportion of prey consumed is a more sensitive test of functional response shape, especially at low prey densities, when a non-linear curve may not be able to distinguish the subtle difference in curve shape.

The logic follows that on the proportion scale, a type-II response will show an increasing (i.e. positive and statistically different from zero) initial slope with respect to density whereas a type-III response will show a negative slope, followed by a positive higher order slope.

The test proceeds by fitting two models:

glm(cbind(eaten,noteaten)~density, family='binomial')

glm(cbind(eaten,noteaten)~density+density^2, family='binomial')

where eaten is the left hand side of the formula input, density is the right hand side and noteaten is the difference between the two. The output from these models to determine which functional response is preferred using the logic above.

Currently no consideration is given to a type-I (i.e. linear) response or any other potentially sensible fit other than a type-II or type-III response. It is up to the user to decide if it is appropriate to continue with fitting a mechanistic model of the functional response (i.e. frair_fit, frair_compare and/or frair_boot) on the back of the results of this test.

Value

frair_test returns a list of class frtest with the following items:

call

The original call to frair_test.

x

The original x data supplied to frair_test.

y

The proportion of prey eaten: y/x

xvar

A string. The right hand side of formula.

yvar

A string. Always 'Proportion'.

modT2

The output from the type-II glm

modT3

The output form the type-III glm

Author(s)

Daniel Pritchard

References

Juliano SA (2001) Nonlinear curve fitting: Predation and functional response curves. In: Scheiner SM, Gurevitch J (eds). Design and analysis of ecological experiments. Oxford University Press, Oxford, United Kingdom. pp 178–196.

See Also

frair_fit

Examples

1
2
3
4
5
data(gammarus)
frair_test(eaten~density, data=gammarus)

dat <- data.frame(x=1:100, y=floor(hassIII(1:100,b=0.01,c=0.001,h=0.03,T=1)))
frair_test(y~x, data=dat)

Example output

Loading required package: stats4
Loading required package: bbmle
FUNCTIONAL RESPONSE TEST

Evidence for type-II response:	Yes
Evidence for type-III response:	-

Type-II logistic regression output:
          Estimate Std. Error z value  Pr(>|z|)    
density -0.0792704  0.0044298 -17.895 < 2.2e-16 ***
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
FUNCTIONAL RESPONSE TEST

Evidence for type-II response:	No
Evidence for type-III response:	Yes

Type-III logistic regression output:
                Estimate  Std. Error z value  Pr(>|z|)    
density       0.04693909  0.00791797  5.9282 3.063e-09 ***
I(density^2) -0.00034211  0.00006241 -5.4817 4.212e-08 ***
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

frair documentation built on May 2, 2019, 8:17 a.m.