EVOLUTION-MANAGER
Edit File: Beta.html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><title>R: GAM beta regression family</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <link rel="stylesheet" type="text/css" href="R.css" /> </head><body> <table width="100%" summary="page for betar {mgcv}"><tr><td>betar {mgcv}</td><td style="text-align: right;">R Documentation</td></tr></table> <h2>GAM beta regression family</h2> <h3>Description</h3> <p>Family for use with <code><a href="gam.html">gam</a></code> or <code><a href="bam.html">bam</a></code>, implementing regression for beta distributed data on (0,1). A linear predictor controls the mean, <i>mu</i> of the beta distribution, while the variance is then <i>mu(1-mu)/(1+phi)</i>, with parameter <i>phi</i> being estimated during fitting, alongside the smoothing parameters. </p> <h3>Usage</h3> <pre> betar(theta = NULL, link = "logit",eps=.Machine$double.eps*100) </pre> <h3>Arguments</h3> <table summary="R argblock"> <tr valign="top"><td><code>theta</code></td> <td> <p>the extra parameter (<i>phi</i> above). </p> </td></tr> <tr valign="top"><td><code>link</code></td> <td> <p>The link function: one of <code>"logit"</code>, <code>"probit"</code>, <code>"cloglog"</code> and <code>"cauchit"</code>.</p> </td></tr> <tr valign="top"><td><code>eps</code></td> <td> <p>the response variable will be truncated to the interval <code>[eps,1-eps]</code> if there are values outside this range. This truncation is not entirely benign, but too small a value of <code>eps</code> will cause stability problems if there are zeroes or ones in the response.</p> </td></tr> </table> <h3>Details</h3> <p>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 <code>eps</code> argument (in fact any observation <code><eps</code> is reset to <code>eps</code> and any observation <code>>1-eps</code> is reset to <code>1-eps</code>). Note the effect of this resetting. If <i>mu*phi>1</i> then impossible 0s are replaced with highly improbable <code>eps</code> values. If the inequality is reversed then 0s with infinite probability density are replaced with <code>eps</code> values having high finite probability density. The equivalent condition for 1s is <i>(1-mu)*phi>1</i>. 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). </p> <h3>Value</h3> <p>An object of class <code>extended.family</code>. </p> <h3>WARNINGS</h3> <p>Do read the details section if your data contain 0s and or 1s. </p> <h3>Author(s)</h3> <p> Natalya Pya (nat.pya@gmail.com) and Simon Wood (s.wood@r-project.org) </p> <h3>Examples</h3> <pre> library(mgcv) ## Simulate some beta data... set.seed(3);n<-400 dat <- gamSim(1,n=n) mu <- binomial()$linkinv(dat$f/4-2) phi <- .5 a <- mu*phi;b <- phi - a; dat$y <- rbeta(n,a,b) bm <- gam(y~s(x0)+s(x1)+s(x2)+s(x3),family=betar(link="logit"),data=dat) bm plot(bm,pages=1) </pre> <hr /><div style="text-align: center;">[Package <em>mgcv</em> version 1.8-28 <a href="00Index.html">Index</a>]</div> </body></html>