Description Usage Arguments Details Value Authors Examples

artificial.data creates an artifical data set of multispecies presence absence data based on a binomial response

1 | ```
artificial.data(formula,data,theta,S,dist="bernoulli")
``` |

` formula` |
an object of class "formula" (or one that can be coerced to that class):a symbolic description of the model to be fitted |

` data` |
a data frame containing the variables in the formula |

` theta` |
coefficents for each species archetype. Matrix of G x number of parameters. Each row is a different species archetype. |

` S` |
number of species to create |

` dist` |
The distribution to sample from, "bernoulli" gives presence/absence (default), "negbin" gives abundances. For negbin, intercepts are chosen at random from -5 to 5, theta held at 1. |

each species is a random realisation of the archetype species

a list with elements pa (matrix of presence absence data) and group (membership of each species to each group)

Piers Dunstan and Scott Foster

1 2 3 4 5 6 7 8 | ```
## for bernoulli
theta <- matrix(c(-0.9,-0.6,0.5,1,-0.9,1,0.9,-0.9),4,2,byrow=TRUE)
dat <- data.frame(y=rep(1,100),x=runif(100,0,2.5))
dat1 <- artificial.data(y~1+x,dat,theta,20)
## for negbin
theta <- matrix(c(-0.9,-0.6,0.5,1,-0.9,1,0.9,-0.9),4,2,byrow=TRUE)
dat <- data.frame(y=rep(1,100),x=runif(100,0,2.5))
dat1 <- artificial.data(y~1+x,dat,theta,20,dist="negbin")
``` |

SpeciesMix documentation built on May 29, 2017, 5:47 p.m.

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.