This function extends betta() to permit random effects modelling.

1 | ```
betta_random(chats, ses, X = NA, groups)
``` |

`chats` |
A vector of estimates of total diversity at different sampling locations. |

`ses` |
The standard errors in chats, the diversity estimates. |

`X` |
A numeric matrix of covariates corresponding to fixed effects. If not supplied, an intercept-only model will be fit. |

`groups` |
A categorical variable representing the random-effects groups that each of the estimates belong to. |

`table` |
A coefficient table for the model parameters. The columns give the parameter estimates, standard errors, and p-values, respectively. This model is only as effective as your diversity estimation procedure; for this reason please confirm that your estimates are appropriate and that your model is not misspecified. betta_pic may be useful for this purpose. |

`cov` |
Estimated covariance matrix of the parameter estimates. |

`ssq_u` |
The estimate of the heterogeneity variance. |

`ssq_g` |
Estimates of within-group variance. The estimate will be zero for groups with only one observation. |

`homogeneity` |
The test statistic and p-value for the test of homogeneity. |

`global` |
The test statistic and p-value for the test of model explanatory power. |

`blups` |
The conditional expected values of the diversity estimates (conditional on the random effects). Estimates of variability for the random effects case are unavailable at this time; please contact the maintainer if needed. |

Amy Willis

Willis, A., Bunge, J., and Whitman, T. (2015). Inference for changes in biodiversity. *arXiv preprint.*

`betta`

; `betta_pic`

1 2 3 4 5 6 7 |

Questions? Problems? Suggestions? Tweet to @rdrrHQ or email at ian@mutexlabs.com.

All documentation is copyright its authors; we didn't write any of that.