View source: R/beta_analysis.R
beta_reg | R Documentation |
This function performs beta regression analysis.
beta_reg(
trat,
resp,
sample.curve = 1000,
ylab = "Dependent",
xlab = "Independent",
theme = theme_classic(),
legend.position = "top",
error = "SE",
r2 = "all",
point = "all",
width.bar = NA,
scale = "none",
textsize = 12,
pointsize = 4.5,
linesize = 0.8,
linetype = 1,
pointshape = 21,
fillshape = "gray",
colorline = "black",
round = NA,
xname.formula = "x",
yname.formula = "y",
comment = NA,
fontfamily = "sans"
)
trat |
Numeric vector with dependent variable. |
resp |
Numeric vector with independent variable. |
sample.curve |
Provide the number of observations to simulate curvature (default is 1000) |
ylab |
Variable response name (Accepts the expression() function) |
xlab |
Treatments name (Accepts the expression() function) |
theme |
ggplot2 theme (default is theme_bw()) |
legend.position |
Legend position (default is "top") |
error |
Error bar (It can be SE - default, SD or FALSE) |
r2 |
Coefficient of determination of the mean or all values (default is all) |
point |
Defines whether you want to plot all points ("all") or only the mean ("mean") |
width.bar |
Bar width |
scale |
Sets x scale (default is none, can be "log") |
textsize |
Font size |
pointsize |
Shape size |
linesize |
Line size |
linetype |
line type |
pointshape |
Format point (default is 21) |
fillshape |
Fill shape |
colorline |
Color lines |
round |
round equation |
xname.formula |
Name of x in the equation |
yname.formula |
Name of y in the equation |
comment |
Add text after equation |
fontfamily |
Font family |
The beta model is defined by:
Y = d \times \{(\frac{X-X_b}{X_o-X_b})(\frac{X_c-X}{X_c-X_o})^{\frac{X_c-X_o}{X_o-X_b}}\}^b
The function returns a list containing the coefficients and their respective values of p; statistical parameters such as AIC, BIC, pseudo-R2, RMSE (root mean square error); largest and smallest estimated value and the graph using ggplot2 with the equation automatically.
Model imported from the aomisc package (Andrea Onofri)
Gabriel Danilo Shimizu
Leandro Simoes Azeredo Goncalves
Onofri, A., 2020. The broken bridge between biologists and statisticians: a blog and R package. Statforbiology. http://www.statforbiology.com/tags/aomisc/
library(AgroReg)
X <- c(1, 5, 10, 15, 20, 25, 30, 35, 40, 45, 50)
Y <- c(0, 0, 0, 7.7, 12.3, 19.7, 22.4, 20.3, 6.6, 0, 0)
beta_reg(X,Y)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.