Family for use with
bam, implementing regression for beta distributed data on (0,1).
A linear predictor controls the mean, mu of the beta distribution, while the variance is then
mu(1-mu)/(1+phi), with parameter phi being estimated during
fitting, alongside the smoothing parameters.
the extra parameter (phi above).
The link function: one of
the response variable will be truncated to the interval
These models are useful for proportions data which can not be modelled as binomial. Note the assumption that data are in
(0,1), despite the fact that for some parameter values 0 and 1 are perfectly legitimate observations. The restriction is needed to
keep the log likelihood bounded for all parameter values. Any data exactly at 0 or 1 are reset to be just above 0 or just below 1 using the
eps argument (in fact any observation
<eps is reset to
eps and any observation
>1-eps is reset to
1-eps). Note the effect of this resetting. If mu*phi>1 then impossible 0s are replaced with highly improbable
eps values. If the inequality is reversed then 0s with infinite probability density are replaced with
eps values having high finite probability density. The equivalent condition for 1s is (1-mu)*phi>1. Clearly all types of resetting are somewhat unsatisfactory, and care is needed if data contain 0s or 1s (often it makes sense to manually reset the 0s and 1s in a manner that somehow reflects the sampling setup).
An object of class
Do read the details section if your data contain 0s and or 1s.
Natalya Pya (email@example.com) and Simon Wood (firstname.lastname@example.org)
1 2 3 4 5 6 7 8 9 10 11 12 13
Loading required package: nlme This is mgcv 1.8-25. For overview type 'help("mgcv-package")'. Gu & Wahba 4 term additive model Family: Beta regression(0.491) Link function: logit Formula: y ~ s(x0) + s(x1) + s(x2) + s(x3) Estimated degrees of freedom: 1.73 1.63 5.62 1.00 total = 10.98 REML score: -991.9735
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.