Title: | Regression Analysis Linear and Nonlinear for Agriculture |
---|---|
Description: | Linear and nonlinear regression analysis common in agricultural science articles (Archontoulis & Miguez (2015). <doi:10.2134/agronj2012.0506>). The package includes polynomial, exponential, gaussian, logistic, logarithmic, segmented, non-parametric models, among others. The functions return the model coefficients and their respective p values, coefficient of determination, root mean square error, AIC, BIC, as well as graphs with the equations automatically. |
Authors: | Gabriel Danilo Shimizu [aut, cre] , Leandro Simoes Azeredo Goncalves [aut, ctb] |
Maintainer: | Gabriel Danilo Shimizu <[email protected]> |
License: | GPL (>= 2) |
Version: | 1.2.10 |
Built: | 2024-11-20 05:06:52 UTC |
Source: | https://github.com/cran/AgroReg |
Adjust y and x scale for chart or charts
adjust_scale( plots, scale.x = "default", limits.x = "default", scale.y = "default", limits.y = "default" )
adjust_scale( plots, scale.x = "default", limits.x = "default", scale.y = "default", limits.y = "default" )
plots |
Object of analysis or plot_arrange |
scale.x |
x-axis scale (use vector) |
limits.x |
limits in x-axis (use vector) |
scale.y |
y-axis scale (use vector) |
limits.y |
limits in y-axis (use vector) |
Returns the scaled graph
library(AgroReg) data("aristolochia") attach(aristolochia) a=LM(trat,resp) b=LL(trat,resp,npar = "LL.3") a=plot_arrange(list(a,b),gray = TRUE) adjust_scale(a,scale.y = seq(0,100,10),limits.y = c(0,100))
library(AgroReg) data("aristolochia") attach(aristolochia) a=LM(trat,resp) b=LL(trat,resp,npar = "LL.3") a=plot_arrange(list(a,b),gray = TRUE) adjust_scale(a,scale.y = seq(0,100,10),limits.y = c(0,100))
Adjust x scale for chart or charts
adjust_scale_x(plots, scale = "default", limits = "default")
adjust_scale_x(plots, scale = "default", limits = "default")
plots |
Object of analysis or plot_arrange |
scale |
x-axis scale (use vector) |
limits |
limits in x-axis (use vector) |
Returns the scaled graph
library(AgroReg) data("aristolochia") attach(aristolochia) a=LM(trat,resp) b=LL(trat,resp,npar = "LL.3") a=plot_arrange(list(a,b),gray = TRUE) adjust_scale_x(a,scale = seq(10,40,5),limits = c(10,40))
library(AgroReg) data("aristolochia") attach(aristolochia) a=LM(trat,resp) b=LL(trat,resp,npar = "LL.3") a=plot_arrange(list(a,b),gray = TRUE) adjust_scale_x(a,scale = seq(10,40,5),limits = c(10,40))
Adjust y scale for chart or charts
adjust_scale_y(plots, scale = "default", limits = "default")
adjust_scale_y(plots, scale = "default", limits = "default")
plots |
Object of analysis or plot_arrange |
scale |
y-axis scale (use vector) |
limits |
limits in y-axis (use vector) |
Returns the scaled graph
library(AgroReg) data("aristolochia") attach(aristolochia) a=LM(trat,resp) b=LL(trat,resp,npar = "LL.3") a=plot_arrange(list(a,b),gray = TRUE) adjust_scale_y(a,scale = seq(0,100,10),limits = c(0,100))
library(AgroReg) data("aristolochia") attach(aristolochia) a=LM(trat,resp) b=LL(trat,resp,npar = "LL.3") a=plot_arrange(list(a,b),gray = TRUE) adjust_scale_y(a,scale = seq(0,100,10),limits = c(0,100))
This function performs Avhad and Marchetti regression analysis.
AM( trat, resp, initial = list(alpha, k, n), 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" )
AM( trat, resp, initial = list(alpha, k, n), 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. |
initial |
Starting estimates |
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 Avhad e Marchetti model is defined by:
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.
Gabriel Danilo Shimizu
Leandro Simoes Azeredo Goncalves
Seber, G. A. F. and Wild, C. J (1989) Nonlinear Regression, New York: Wiley & Sons (p. 330).
Avhad, M. R., & Marchetti, J. M. (2016). Mathematical modelling of the drying kinetics of Hass avocado seeds. Industrial Crops and Products, 91, 76-87.
library(AgroReg) data("granada") attach(granada) AM(time,100-WL,initial=list(alpha = 610.9129, k=-1.1810, n=0.1289 ))
library(AgroReg) data("granada") attach(granada) AM(time,100-WL,initial=list(alpha = 610.9129, k=-1.1810, n=0.1289 ))
The data come from an experiment conducted at the Seed Analysis Laboratory of the Agricultural Sciences Center of the State University of Londrina, in which five temperatures (15, 20, 25, 30 and 35C) were evaluated in the germination of Aristolochia elegans. The experiment was conducted in a completely randomized design with four replications of 25 seeds each.
data("aristolochia")
data("aristolochia")
data.frame containing data set
trat
Numeric vector with temperature
resp
Numeric vector with response
Hugo Roldi Guariz
data(aristolochia)
data(aristolochia)
This function performs asymptotic regression analysis.
asymptotic( 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" )
asymptotic( 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 exponential model is defined by:
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.
Gabriel Danilo Shimizu
Leandro Simoes Azeredo Goncalves
Seber, G. A. F. and Wild, C. J (1989) Nonlinear Regression, New York: Wiley and Sons (p. 330).
library(AgroReg) data("granada") attach(granada) asymptotic(time,100-WL)
library(AgroReg) data("granada") attach(granada) asymptotic(time,100-WL)
This function performs asymptotic regression analysis without intercept.
asymptotic_i( 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", fontfamily = "sans", comment = NA )
asymptotic_i( 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", fontfamily = "sans", comment = NA )
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 |
fontfamily |
Font family |
comment |
Add text after equation |
The asymptotic model without intercept is defined by:
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.
Gabriel Danilo Shimizu
Leandro Simoes Azeredo Goncalves
Seber, G. A. F. and Wild, C. J (1989) Nonlinear Regression, New York: Wiley and Sons (p. 330).
Siqueira, V. C., Resende, O., & Chaves, T. H. (2013). Mathematical modelling of the drying of jatropha fruit: an empirical comparison. Revista Ciencia Agronomica, 44, 278-285.
library(AgroReg) data("granada") attach(granada) asymptotic_i(time,100-WL)
library(AgroReg) data("granada") attach(granada) asymptotic_i(time,100-WL)
This function performs asymptotic regression analysis without intercept.
asymptotic_ineg( 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" )
asymptotic_ineg( 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 asymptotic negative model without intercept is defined by:
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.
Gabriel Danilo Shimizu
Leandro Simoes Azeredo Goncalves
Seber, G. A. F. and Wild, C. J (1989) Nonlinear Regression, New York: Wiley & Sons (p. 330).
Siqueira, V. C., Resende, O., & Chaves, T. H. (2013). Mathematical modelling of the drying of jatropha fruit: an empirical comparison. Revista Ciencia Agronomica, 44, 278-285.
library(AgroReg) data("granada") attach(granada) asymptotic_ineg(time,100-WL)
library(AgroReg) data("granada") attach(granada) asymptotic_ineg(time,100-WL)
This function performs asymptotic regression analysis.
asymptotic_neg( 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" )
asymptotic_neg( 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 asymptotic model is defined by:
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.
Gabriel Danilo Shimizu
Leandro Simoes Azeredo Goncalves
Seber, G. A. F. and Wild, C. J (1989) Nonlinear Regression, New York: Wiley & Sons (p. 330).
library(AgroReg) data("granada") attach(granada) asymptotic_neg(time,WL)
library(AgroReg) data("granada") attach(granada) asymptotic_neg(time,WL)
The 'BC.4' and 'BC.5' logistical models provide Brain-Cousens' modified logistical models to describe u-shaped hormesis. This model was extracted from the 'drc' package.
BC( trat, resp, npar = "BC.4", sample.curve = 1000, ylab = "Dependent", xlab = "Independent", theme = theme_classic(), legend.position = "top", r2 = "all", ic = FALSE, fill.ic = "gray70", alpha.ic = 0.5, error = "SE", 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" )
BC( trat, resp, npar = "BC.4", sample.curve = 1000, ylab = "Dependent", xlab = "Independent", theme = theme_classic(), legend.position = "top", r2 = "all", ic = FALSE, fill.ic = "gray70", alpha.ic = 0.5, error = "SE", 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. |
npar |
Number of model parameters (default is BC.4) |
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") |
r2 |
Coefficient of determination of the mean or all values (default is all) |
ic |
Add interval of confidence |
fill.ic |
Color interval of confidence |
alpha.ic |
confidence interval transparency level |
error |
Error bar (It can be SE - default, SD or FALSE) |
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 model function for the Brain-Cousens model (Brain and Cousens, 1989) is
and it is a five-parameter model, obtained by extending the four-parameter log-logistic model (LL.4 to take into account inverse u-shaped hormesis effects. Fixing the lower limit at 0 yields the four-parameter model
used by van Ewijk and Hoekstra (1993).
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 drc package (Ritz et al., 2016)
Gabriel Danilo Shimizu
Leandro Simoes Azeredo Goncalves
Seber, G. A. F. and Wild, C. J (1989) Nonlinear Regression, New York: Wiley & Sons (p. 330).
Ritz, C.; Strebig, J.C. and Ritz, M.C. Package ‘drc’. Creative Commons: Mountain View, CA, USA, 2016.
library(AgroReg) data("aristolochia") attach(aristolochia) BC(trat,resp)
library(AgroReg) data("aristolochia") attach(aristolochia) BC(trat,resp)
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" )
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:
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)
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)
This function performs biexponential regression analysis.
biexponential( 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" )
biexponential( 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 biexponential model is defined by:
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.
Gabriel Danilo Shimizu
Leandro Simoes Azeredo Goncalves
Seber, G. A. F. and Wild, C. J (1989) Nonlinear Regression, New York: Wiley & Sons (p. 330).
library(AgroReg) data("granada") attach(granada) biexponential(time,WL)
library(AgroReg) data("granada") attach(granada) biexponential(time,WL)
The 'CRS.4' and 'CRS.5' logistical models provide Brain-Cousens modified logistical models to describe u-shaped hormesis. This model was extracted from the 'drc' package.
CD( trat, resp, npar = "CRS.4", sample.curve = 1000, ylab = "Dependent", xlab = "Independent", theme = theme_classic(), legend.position = "top", error = "SE", r2 = "all", ic = FALSE, fill.ic = "gray70", alpha.ic = 0.5, 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" )
CD( trat, resp, npar = "CRS.4", sample.curve = 1000, ylab = "Dependent", xlab = "Independent", theme = theme_classic(), legend.position = "top", error = "SE", r2 = "all", ic = FALSE, fill.ic = "gray70", alpha.ic = 0.5, 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. |
npar |
Number of model parameters |
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_classic()) |
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) |
ic |
Add interval of confidence |
fill.ic |
Color interval of confidence |
alpha.ic |
confidence interval transparency level |
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 four-parameter model is given by the expression:
while the five-parameter is:
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 drc package (Ritz et al., 2016)
Gabriel Danilo Shimizu
Leandro Simoes Azeredo Goncalves
Seber, G. A. F. and Wild, C. J (1989) Nonlinear Regression, New York: Wiley & Sons (p. 330).
Ritz, C.; Strebig, J.C.; Ritz, M.C. Package 'drc'. Creative Commons: Mountain View, CA, USA, 2016.
library(AgroReg) data("aristolochia") attach(aristolochia) CD(trat,resp)
library(AgroReg) data("aristolochia") attach(aristolochia) CD(trat,resp)
Change the colors of a graph from the plot_arrange function
coloredit_arrange(graphs, color = NA)
coloredit_arrange(graphs, color = NA)
graphs |
object from a plot_arrange function |
color |
color curve and point |
The function changes the colors of a graph coming from the plot_arrange function
Gabriel Danilo Shimizu
library(AgroReg) data("aristolochia") attach(aristolochia) graph1=LM(trat,resp) graph2=LL(trat,resp,npar = "LL.3") graph=plot_arrange(list(graph1,graph2)) coloredit_arrange(graph,color=c("red","blue"))
library(AgroReg) data("aristolochia") attach(aristolochia) graph1=LM(trat,resp) graph2=LL(trat,resp,npar = "LL.3") graph=plot_arrange(list(graph1,graph2)) coloredit_arrange(graph,color=c("red","blue"))
This function allows the construction of a table and/or graph with the statistical parameters to choose the model from the analysis functions.
comparative_model(models, names_model = NA, plot = FALSE, round.label = 2)
comparative_model(models, names_model = NA, plot = FALSE, round.label = 2)
models |
List with objects of type analysis |
names_model |
Names of the models |
plot |
Plot in the parameters |
round.label |
Round label plot |
Returns a table and/or graph with the statistical parameters for choosing the model.
Gabriel Danilo Shimizu
Correlation analysis function (Pearson or Spearman)
correlation( x, y, method = "pearson", ylab = "Dependent", xlab = "Independent", theme = theme_classic(), textsize = 12, pointsize = 5, pointshape = 21, linesize = 0.8, fill.ic = "gray70", alpha.ic = 0.5, ic = TRUE, title = NA, fontfamily = "sans" )
correlation( x, y, method = "pearson", ylab = "Dependent", xlab = "Independent", theme = theme_classic(), textsize = 12, pointsize = 5, pointshape = 21, linesize = 0.8, fill.ic = "gray70", alpha.ic = 0.5, ic = TRUE, title = NA, fontfamily = "sans" )
x |
Numeric vector with independent variable |
y |
Numeric vector with dependent variable |
method |
Method correlation (default is Pearson) |
ylab |
Variable response name (Accepts the expression() function) |
xlab |
Treatments name (Accepts the expression() function) |
theme |
ggplot2 theme (default is theme_classic()) |
textsize |
Axis text size |
pointsize |
Point size |
pointshape |
shape format |
linesize |
line size |
fill.ic |
Color interval of confidence |
alpha.ic |
confidence interval transparency level |
ic |
Add interval of confidence |
title |
title |
fontfamily |
Font family |
The function returns a graph for correlation
Gabriel Danilo Shimizu, [email protected]
Leandro Simoes Azeredo Goncalves
data("aristolochia") with(aristolochia, correlation(trat,resp))
data("aristolochia") with(aristolochia, correlation(trat,resp))
This function allows extracting the model (type="model") or residuals (type="resids"). The model class depends on the function and can be (lm, drm or nls). This function also allows you to perform graphical analysis of residuals (type="residplot"), graphical analysis of standardized residuals (type="stdresidplot"), graph of theoretical quantiles (type="qqplot").
extract.model(model, type = "model")
extract.model(model, type = "model")
model |
Object returned from an analysis function |
type |
output type |
Returns an object of class drm, lm or nls (type="model"), or vector of residuals (type="resids"), or graph of the residuals (type="residplot", type="stdresidplot", type=" qqplot").
data("aristolochia") attach(aristolochia) a=linear.linear(trat,resp,point = "mean") extract.model(a,type = "qqplot")
data("aristolochia") attach(aristolochia) a=linear.linear(trat,resp,point = "mean") extract.model(a,type = "qqplot")
Analysis: Analogous to the Gaussian model/Bragg
gaussianreg( trat, resp, npar = "g3", sample.curve = 1000, ylab = "Dependent", xlab = "Independent", theme = theme_classic(), error = "SE", legend.position = "top", 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" )
gaussianreg( trat, resp, npar = "g3", sample.curve = 1000, ylab = "Dependent", xlab = "Independent", theme = theme_classic(), error = "SE", legend.position = "top", 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. |
npar |
number of parameters (g3 or g4) |
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_classic()) |
error |
Error bar (It can be SE - default, SD or FALSE) |
legend.position |
legend position (default is "top") |
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 model analogous to the three-parameter Gaussian is:
The model analogous to the three-parameter Gaussian is:
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.
Gabriel Danilo Shimizu
Leandro Simoes Azeredo Goncalves
library(AgroReg) data("aristolochia") attach(aristolochia) gaussianreg(trat,resp)
library(AgroReg) data("aristolochia") attach(aristolochia) gaussianreg(trat,resp)
The logistical models provide Gompertz modified logistical models. This model was extracted from the 'drc' package.
GP( trat, resp, npar = "g2", sample.curve = 1000, ylab = "Dependent", xlab = "Independent", theme = theme_classic(), legend.position = "top", r2 = "all", ic = FALSE, fill.ic = "gray70", alpha.ic = 0.5, error = "SE", 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" )
GP( trat, resp, npar = "g2", sample.curve = 1000, ylab = "Dependent", xlab = "Independent", theme = theme_classic(), legend.position = "top", r2 = "all", ic = FALSE, fill.ic = "gray70", alpha.ic = 0.5, error = "SE", 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. |
npar |
Number os parameters (g2, g3 or g4) |
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") |
r2 |
coefficient of determination of the mean or all values (default is all) |
ic |
Add interval of confidence |
fill.ic |
Color interval of confidence |
alpha.ic |
confidence interval transparency level |
error |
Error bar (It can be SE - default, SD or FALSE) |
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 two-parameter Gompertz model is given by the function:
The three-parameter Gompertz model is given by the function:
The four-parameter Gompertz model is given by the function:
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 drc package (Ritz et al., 2016)
Gabriel Danilo Shimizu
Leandro Simoes Azeredo Goncalves
Seber, G. A. F. and Wild, C. J (1989) Nonlinear Regression, New York: Wiley and Sons (p. 330).
Ritz, C.; Strebig, J.C. and Ritz, M.C. Package ‘drc’. Creative Commons: Mountain View, CA, USA, 2016.
library(AgroReg) data("aristolochia") attach(aristolochia) GP(trat,resp, npar="g3")
library(AgroReg) data("aristolochia") attach(aristolochia) GP(trat,resp, npar="g3")
The data are part of an experiment that studied the drying kinetics of pomegranate peel over time under an air-circulation oven. Mass loss was assessed.
data("granada")
data("granada")
data.frame containing data set
time
numeric vector with times
WL
Numeric vector with response
Gabriel Danilo Shimizu
data(granada)
data(granada)
This function performs regression analysis using the Hill model.
hill( trat, resp, sample.curve = 1000, error = "SE", ylab = "Dependent", xlab = "Independent", theme = theme_classic(), legend.position = "top", point = "all", width.bar = NA, r2 = "all", 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" )
hill( trat, resp, sample.curve = 1000, error = "SE", ylab = "Dependent", xlab = "Independent", theme = theme_classic(), legend.position = "top", point = "all", width.bar = NA, r2 = "all", 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) |
error |
Error bar (It can be SE - default, SD or FALSE) |
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") |
point |
defines whether you want to plot all points ("all") or only the mean ("mean") |
width.bar |
Bar width |
r2 |
coefficient of determination of the mean or all values (default is all) |
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 Hill model is defined by:
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 (Onofri, 2020)
Gabriel Danilo Shimizu
Seber, G. A. F. and Wild, C. J (1989) Nonlinear Regression, New York: Wiley & Sons (p. 330).
Onofri A. (2020) The broken bridge between biologists and statisticians: a blog and R package, Statforbiology, IT, web: https://www.statforbiology.com
data("granada") attach(granada) hill(time,WL)
data("granada") attach(granada) hill(time,WL)
Interval of confidence in model regression
interval.confidence(model)
interval.confidence(model)
model |
Object analysis |
Return in the interval of confidence
Gabriel Danilo Shimizu
data("granada") attach(granada) a=LM(time, WL) interval.confidence(a)
data("granada") attach(granada) a=LM(time, WL) interval.confidence(a)
This function performs linear linear regression analysis.
linear.linear( trat, resp, middle = 1, CI = FALSE, bootstrap.samples = 1000, sig.level = 0.05, error = "SE", ylab = "Dependent", xlab = "Independent", theme = theme_classic(), point = "all", width.bar = NA, legend.position = "top", 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" )
linear.linear( trat, resp, middle = 1, CI = FALSE, bootstrap.samples = 1000, sig.level = 0.05, error = "SE", ylab = "Dependent", xlab = "Independent", theme = theme_classic(), point = "all", width.bar = NA, legend.position = "top", 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. |
middle |
A scalar in [0,1]. This represents the range that the change-point can occur in. 0 means the change-point must occur at the middle of the range of x-values. 1 means that the change-point can occur anywhere along the range of the x-values. |
CI |
Whether or not a bootstrap confidence interval should be calculated. Defaults to FALSE because the interval takes a non-trivial amount of time to calculate |
bootstrap.samples |
The number of bootstrap samples to take when calculating the CI. |
sig.level |
What significance level to use for the confidence intervals. |
error |
Error bar (It can be SE - default, SD or FALSE) |
ylab |
Variable response name (Accepts the expression() function) |
xlab |
treatments name (Accepts the expression() function) |
theme |
ggplot2 theme (default is theme_classic()) |
point |
defines whether you want to plot all points ("all") or only the mean ("mean") |
width.bar |
Bar width |
legend.position |
legend position (default is "top") |
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 linear-linear model is defined by: First curve:
Second curve:
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); breakpoint and the graph using ggplot2 with the equation automatically.
Model imported from the SiZer package
Gabriel Danilo Shimizu
Leandro Simoes Azeredo Goncalves
Chiu, G. S., R. Lockhart, and R. Routledge. 2006. Bent-cable regression theory and applications. Journal of the American Statistical Association 101:542-553.
Toms, J. D., and M. L. Lesperance. 2003. Piecewise regression: a tool for identifying ecological thresholds. Ecology 84:2034-2041.
quadratic.plateau, linear.plateau
library(AgroReg) data("granada") attach(granada) linear.linear(time,WL)
library(AgroReg) data("granada") attach(granada) linear.linear(time,WL)
This function performs the linear-plateau regression analysis.
linear.plateau( 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" )
linear.plateau( 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 linear-plateau model is defined by: First curve:
Second curve:
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); breakpoint and the graph using ggplot2 with the equation automatically.
Gabriel Danilo Shimizu
Leandro Simoes Azeredo Goncalves
Chiu, G. S., R. Lockhart, and R. Routledge. 2006. Bent-cable regression theory and applications. Journal of the American Statistical Association 101:542-553.
Toms, J. D., and M. L. Lesperance. 2003. Piecewise regression: a tool for identifying ecological thresholds. Ecology 84:2034-2041.
quadratic.plateau, linear.linear
library(AgroReg) data("granada") attach(granada) linear.plateau(time,WL)
library(AgroReg) data("granada") attach(granada) linear.plateau(time,WL)
Logistic models with three (LL.3), four (LL.4) or five (LL.5) continuous data parameters. This model was extracted from the drc package.
LL( trat, resp, npar = "LL.3", sample.curve = 1000, ylab = "Dependent", xlab = "Independent", theme = theme_classic(), legend.position = "top", error = "SE", r2 = "all", ic = FALSE, fill.ic = "gray70", alpha.ic = 0.5, 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" )
LL( trat, resp, npar = "LL.3", sample.curve = 1000, ylab = "Dependent", xlab = "Independent", theme = theme_classic(), legend.position = "top", error = "SE", r2 = "all", ic = FALSE, fill.ic = "gray70", alpha.ic = 0.5, 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. |
npar |
Number of model parameters |
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) |
ic |
Add interval of confidence |
fill.ic |
Color interval of confidence |
alpha.ic |
confidence interval transparency level |
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 three-parameter log-logistic function with lower limit 0 is
The four-parameter log-logistic function is given by the expression
The function is symmetric about the inflection point (e).
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 drc package (Ritz et al., 2016)
Gabriel Danilo Shimizu
Leandro Simoes Azeredo Goncalves
Seber, G. A. F. and Wild, C. J (1989) Nonlinear Regression, New York: Wiley & Sons (p. 330).
Ritz, C.; Strebig, J.C.; Ritz, M.C. Package ‘drc’. Creative Commons: Mountain View, CA, USA, 2016.
library(AgroReg) data("aristolochia") attach(aristolochia) LL(trat,resp)
library(AgroReg) data("aristolochia") attach(aristolochia) LL(trat,resp)
Linear, quadratic, quadratic inverse, cubic and quartic regression.
LM( trat, resp, degree = NA, sample.curve = 1000, ylab = "Dependent", xlab = "Independent", error = "SE", ic = FALSE, fill.ic = "gray70", alpha.ic = 0.5, point = "all", r2 = "all", theme = theme_classic(), legend.position = "top", 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" )
LM( trat, resp, degree = NA, sample.curve = 1000, ylab = "Dependent", xlab = "Independent", error = "SE", ic = FALSE, fill.ic = "gray70", alpha.ic = 0.5, point = "all", r2 = "all", theme = theme_classic(), legend.position = "top", 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. |
degree |
degree of the polynomial (0.5, 1, 2, 3 or 4) |
sample.curve |
Provide the number of observations to simulate curvature (default is 1000) |
ylab |
Dependent variable name (Accepts the expression() function) |
xlab |
Independent variable name (Accepts the expression() function) |
error |
Error bar (It can be SE - default, SD or FALSE) |
ic |
Add interval of confidence |
fill.ic |
Color interval of confidence |
alpha.ic |
confidence interval transparency level |
point |
defines whether you want to plot all points ("all") or only the mean ("mean") |
r2 |
coefficient of determination of the mean or all values (default is all) |
theme |
ggplot2 theme (default is theme_classic()) |
legend.position |
legend position (default is "top") |
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 linear model is defined by:
The quadratic model is defined by:
The quadratic inverse model is defined by:
The cubic model is defined by:
The quartic model is defined by:
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.
Gabriel Danilo Shimizu
Leandro Simoes Azeredo Goncalves
library(AgroReg) data("aristolochia") attach(aristolochia) LM(trat,resp, degree = 3)
library(AgroReg) data("aristolochia") attach(aristolochia) LM(trat,resp, degree = 3)
Linear, quadratic, quadratic inverse, cubic and quartic regression.
LM_i( trat, resp, sample.curve = 1000, ylab = "Dependent", error = "SE", ic = FALSE, fill.ic = "gray70", alpha.ic = 0.5, xlab = "Independent", degree = NA, theme = theme_classic(), legend.position = "top", point = "all", r2 = "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" )
LM_i( trat, resp, sample.curve = 1000, ylab = "Dependent", error = "SE", ic = FALSE, fill.ic = "gray70", alpha.ic = 0.5, xlab = "Independent", degree = NA, theme = theme_classic(), legend.position = "top", point = "all", r2 = "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 |
Dependent variable name (Accepts the expression() function) |
error |
Error bar (It can be SE - default, SD or FALSE) |
ic |
Add interval of confidence |
fill.ic |
Color interval of confidence |
alpha.ic |
confidence interval transparency level |
xlab |
Independent variable name (Accepts the expression() function) |
degree |
degree of the polynomial (0.5, 1, 2, 3 or 4) |
theme |
ggplot2 theme (default is theme_classic()) |
legend.position |
legend position (default is "top") |
point |
defines whether you want to plot all points ("all") or only the mean ("mean") |
r2 |
coefficient of determination of the mean or all values (default is all) |
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 linear model is defined by:
The quadratic model is defined by:
The quadratic inverse model is defined by:
The cubic model is defined by:
The quartic model is defined by:
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.
Gabriel Danilo Shimizu
Leandro Simoes Azeredo Goncalves
library(AgroReg) data("aristolochia") attach(aristolochia) LM_i(trat,resp, degree = 3)
library(AgroReg) data("aristolochia") attach(aristolochia) LM_i(trat,resp, degree = 3)
Degree 3 polynomial model without the beta 2 coefficient.
LM13( trat, resp, sample.curve = 1000, ylab = "Dependent", error = "SE", xlab = "Independent", theme = theme_classic(), legend.position = "top", 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" )
LM13( trat, resp, sample.curve = 1000, ylab = "Dependent", error = "SE", xlab = "Independent", theme = theme_classic(), legend.position = "top", 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 |
Dependent variable name (Accepts the expression() function) |
error |
Error bar (It can be SE - default, SD or FALSE) |
xlab |
Independent variable name (Accepts the expression() function) |
theme |
ggplot2 theme (default is theme_classic()) |
legend.position |
legend position (default is "top") |
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 |
Degree 3 polynomial model without the beta 2 coefficient is defined by:
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.
Gabriel Danilo Shimizu
Leandro Simoes Azeredo Goncalves
library(AgroReg) data("granada") attach(granada) LM13(time, WL)
library(AgroReg) data("granada") attach(granada) LM13(time, WL)
Degree 3 polynomial inverse model without the beta 2 coefficient.
LM13i( trat, resp, sample.curve = 1000, ylab = "Dependent", error = "SE", xlab = "Independent", theme = theme_classic(), legend.position = "top", 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" )
LM13i( trat, resp, sample.curve = 1000, ylab = "Dependent", error = "SE", xlab = "Independent", theme = theme_classic(), legend.position = "top", 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 |
Dependent variable name (Accepts the expression() function) |
error |
Error bar (It can be SE - default, SD or FALSE) |
xlab |
Independent variable name (Accepts the expression() function) |
theme |
ggplot2 theme (default is theme_classic()) |
legend.position |
legend position (default is "top") |
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 |
Inverse degree 3 polynomial model without the beta 2 coefficient is defined by:
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.
Gabriel Danilo Shimizu
Leandro Simoes Azeredo Goncalves
library(AgroReg) data("granada") attach(granada) LM13i(time, WL)
library(AgroReg) data("granada") attach(granada) LM13i(time, WL)
Degree 3 polynomial model without the beta 1 coefficient.
LM23( trat, resp, sample.curve = 1000, ylab = "Dependent", error = "SE", xlab = "Independent", theme = theme_classic(), legend.position = "top", 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" )
LM23( trat, resp, sample.curve = 1000, ylab = "Dependent", error = "SE", xlab = "Independent", theme = theme_classic(), legend.position = "top", 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 |
Dependent variable name (Accepts the expression() function) |
error |
Error bar (It can be SE - default, SD or FALSE) |
xlab |
Independent variable name (Accepts the expression() function) |
theme |
ggplot2 theme (default is theme_classic()) |
legend.position |
legend position (default is "top") |
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 |
Degree 3 polynomial model without the beta 2 coefficient is defined by:
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.
Gabriel Danilo Shimizu
Leandro Simoes Azeredo Goncalves
library(AgroReg) data("granada") attach(granada) LM23(time, WL)
library(AgroReg) data("granada") attach(granada) LM23(time, WL)
Degree 3 polynomial inverse model without the beta 1 coefficient.
LM23i( trat, resp, sample.curve = 1000, ylab = "Dependent", error = "SE", xlab = "Independent", theme = theme_classic(), legend.position = "top", 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" )
LM23i( trat, resp, sample.curve = 1000, ylab = "Dependent", error = "SE", xlab = "Independent", theme = theme_classic(), legend.position = "top", 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 |
Dependent variable name (Accepts the expression() function) |
error |
Error bar (It can be SE - default, SD or FALSE) |
xlab |
Independent variable name (Accepts the expression() function) |
theme |
ggplot2 theme (default is theme_classic()) |
legend.position |
legend position (default is "top") |
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 |
Inverse degree 3 polynomial model without the beta 1 coefficient is defined by:
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.
Gabriel Danilo Shimizu
Leandro Simoes Azeredo Goncalves
library(AgroReg) data("granada") attach(granada) LM23i(time, WL)
library(AgroReg) data("granada") attach(granada) LM23i(time, WL)
Degree 3 polynomial model without the beta 1 coefficient, with inverse beta3.
LM2i3( trat, resp, sample.curve = 1000, ylab = "Dependent", error = "SE", xlab = "Independent", theme = theme_classic(), legend.position = "top", 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" )
LM2i3( trat, resp, sample.curve = 1000, ylab = "Dependent", error = "SE", xlab = "Independent", theme = theme_classic(), legend.position = "top", 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 |
Dependent variable name (Accepts the expression() function) |
error |
Error bar (It can be SE - default, SD or FALSE) |
xlab |
Independent variable name (Accepts the expression() function) |
theme |
ggplot2 theme (default is theme_classic()) |
legend.position |
legend position (default is "top") |
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 |
Inverse degree 3 polynomial model without the beta 2 coefficient is defined by:
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.
Gabriel Danilo Shimizu
Leandro Simoes Azeredo Goncalves
library(AgroReg) data("granada") attach(granada) LM2i3(time, WL)
library(AgroReg) data("granada") attach(granada) LM2i3(time, WL)
Fit a polynomial surface determined by one or more numerical predictors, using local fitting.
loessreg( trat, resp, degree = 2, sample.curve = 1000, ylab = "Dependent", xlab = "Independent", theme = theme_classic(), legend.position = "top", error = "SE", point = "all", width.bar = NA, scale = "none", textsize = 12, pointsize = 4.5, linesize = 0.8, linetype = 1, pointshape = 21, fillshape = "gray", colorline = "black", fontfamily = "sans" )
loessreg( trat, resp, degree = 2, sample.curve = 1000, ylab = "Dependent", xlab = "Independent", theme = theme_classic(), legend.position = "top", error = "SE", point = "all", width.bar = NA, scale = "none", textsize = 12, pointsize = 4.5, linesize = 0.8, linetype = 1, pointshape = 21, fillshape = "gray", colorline = "black", fontfamily = "sans" )
trat |
Numeric vector with dependent variable. |
resp |
Numeric vector with independent variable. |
degree |
Degree polynomial (0,1 or 2) |
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 c(0.3,0.8)) |
error |
Error bar (It can be SE - default, SD or FALSE) |
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 |
fontfamily |
Font family |
The function returns a list containing the loess regression and graph using ggplot2.
Gabriel Danilo Shimizu
Leandro Simoes Azeredo Goncalves
library(AgroReg) data("aristolochia") attach(aristolochia) loessreg(trat,resp)
library(AgroReg) data("aristolochia") attach(aristolochia) loessreg(trat,resp)
This function performs logarithmic regression analysis.
LOG( 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" )
LOG( 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 c(0.3,0.8)) |
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 logarithmic model is defined by:
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.
Gabriel Danilo Shimizu
Leandro Simoes Azeredo Goncalves
Seber, G. A. F. and Wild, C. J (1989) Nonlinear Regression, New York: Wiley & Sons (p. 330).
library(AgroReg) resp=c(10,8,6.8,6,5,4.3,4.1,4.2,4.1) trat=seq(1,9,1) LOG(trat,resp)
library(AgroReg) resp=c(10,8,6.8,6,5,4.3,4.1,4.2,4.1) trat=seq(1,9,1) LOG(trat,resp)
This function performs logarithmic quadratic regression analysis.
LOG2( 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" )
LOG2( 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 c(0.3,0.8)) |
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 logarithmic model is defined by:
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.
Gabriel Danilo Shimizu
Leandro Simoes Azeredo Goncalves
Seber, G. A. F. and Wild, C. J (1989) Nonlinear Regression, New York: Wiley & Sons (p. 330).
library(AgroReg) resp=c(10,8,6.8,6,5,4.3,4.1,4.2,4.1) trat=seq(1,9,1) LOG2(trat,resp)
library(AgroReg) resp=c(10,8,6.8,6,5,4.3,4.1,4.2,4.1) trat=seq(1,9,1) LOG2(trat,resp)
Logistic models with three (L.3), four (L.4) or five (L.5) continuous data parameters. This model was extracted from the drc package.
logistic( trat, resp, npar = "L.3", sample.curve = 1000, ylab = "Dependent", xlab = "Independent", theme = theme_classic(), legend.position = "top", error = "SE", r2 = "all", ic = FALSE, fill.ic = "gray70", alpha.ic = 0.5, 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" )
logistic( trat, resp, npar = "L.3", sample.curve = 1000, ylab = "Dependent", xlab = "Independent", theme = theme_classic(), legend.position = "top", error = "SE", r2 = "all", ic = FALSE, fill.ic = "gray70", alpha.ic = 0.5, 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. |
npar |
Number of model parameters |
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) |
ic |
Add interval of confidence |
fill.ic |
Color interval of confidence |
alpha.ic |
confidence interval transparency level |
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 three-parameter logistic function with lower limit 0 is
The four-parameter logistic function is given by the expression
The five-parameter logistic function is given by the expression
The function is symmetric about the inflection point (e).
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 drc package (Ritz et al., 2016)
Gabriel Danilo Shimizu
Leandro Simoes Azeredo Goncalves
Seber, G. A. F. and Wild, C. J (1989) Nonlinear Regression, New York: Wiley & Sons (p. 330).
Ritz, C.; Strebig, J.C.; Ritz, M.C. Package ‘drc’. Creative Commons: Mountain View, CA, USA, 2016.
library(AgroReg) data("aristolochia") attach(aristolochia) logistic(trat,resp)
library(AgroReg) data("aristolochia") attach(aristolochia) logistic(trat,resp)
Analysis: Lorentz
lorentz( trat, resp, npar = "lo3", sample.curve = 1000, ylab = "Dependent", xlab = "Independent", theme = theme_classic(), error = "SE", legend.position = "top", 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" )
lorentz( trat, resp, npar = "lo3", sample.curve = 1000, ylab = "Dependent", xlab = "Independent", theme = theme_classic(), error = "SE", legend.position = "top", 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. |
npar |
number of parameters (lo3 or lo4) |
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_classic()) |
error |
Error bar (It can be SE - default, SD or FALSE) |
legend.position |
legend position (default is "top") |
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 model to the three-parameter Lorentz is:
The model to the three-parameter Lorentz is:
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 (Onofri, 2020)
Gabriel Danilo Shimizu
Seber, G. A. F. and Wild, C. J (1989) Nonlinear Regression, New York: Wiley & Sons (p. 330).
Onofri A. (2020) The broken bridge between biologists and statisticians: a blog and R package, Statforbiology, IT, web: https://www.statforbiology.com
library(AgroReg) data("granada") attach(granada) x=time[length(time):1] lorentz(x,WL)
library(AgroReg) data("granada") attach(granada) x=time[length(time):1] lorentz(x,WL)
This function performs Midilli regression analysis.
midilli( trat, resp, initial = NA, 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, yname.formula = "y", xname.formula = "x", comment = NA, fontfamily = "sans" )
midilli( trat, resp, initial = NA, 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, yname.formula = "y", xname.formula = "x", comment = NA, fontfamily = "sans" )
trat |
Numeric vector with dependent variable. |
resp |
Numeric vector with independent variable. |
initial |
List starting estimates |
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 |
yname.formula |
Name of y in the equation |
xname.formula |
Name of x in the equation |
comment |
Add text after equation |
fontfamily |
Font family |
The exponential model is defined by:
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.
Gabriel Danilo Shimizu
Leandro Simoes Azeredo Goncalves
Seber, G. A. F. and Wild, C. J (1989) Nonlinear Regression, New York: Wiley & Sons (p. 330).
library(AgroReg) data("granada") attach(granada) midilli(time,100-WL)
library(AgroReg) data("granada") attach(granada) midilli(time,100-WL)
This function performs modified Midilli regression analysis.
midillim( trat, resp, initial = NA, 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, yname.formula = "y", xname.formula = "x", comment = NA, fontfamily = "sans" )
midillim( trat, resp, initial = NA, 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, yname.formula = "y", xname.formula = "x", comment = NA, fontfamily = "sans" )
trat |
Numeric vector with dependent variable. |
resp |
Numeric vector with independent variable. |
initial |
List starting estimates |
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 |
yname.formula |
Name of y in the equation |
xname.formula |
Name of x in the equation |
comment |
Add text after equation |
fontfamily |
Font family |
The exponential model is defined by:
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.
Gabriel Danilo Shimizu
Leandro Simoes Azeredo Goncalves
Seber, G. A. F. and Wild, C. J (1989) Nonlinear Regression, New York: Wiley & Sons (p. 330).
library(AgroReg) data("granada") attach(granada) midillim(time,100-WL)
library(AgroReg) data("granada") attach(granada) midillim(time,100-WL)
This function performs Mitscherlich regression analysis.
mitscherlich( trat, resp, initial = NA, 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, yname.formula = "y", xname.formula = "x", comment = NA, fontfamily = "sans" )
mitscherlich( trat, resp, initial = NA, 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, yname.formula = "y", xname.formula = "x", comment = NA, fontfamily = "sans" )
trat |
Numeric vector with dependent variable. |
resp |
Numeric vector with independent variable. |
initial |
List Initial parameters (A, b, e) |
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 |
yname.formula |
Name of y in the equation |
xname.formula |
Name of x in the equation |
comment |
Add text after equation |
fontfamily |
Font family |
The Mitscherlich model is defined by:
where "y" is the yield obtained when "b" units of a nutrient are in the soil and "x" units of it are added as fertilizer, "A" is the maximum yield, and "e" is the proportionality factor, has recently received increasing interest.
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.
Gabriel Danilo Shimizu
Leandro Simoes Azeredo Goncalves
library(AgroReg) data("granada") attach(granada) mitscherlich(time,WL)
library(AgroReg) data("granada") attach(granada) mitscherlich(time,WL)
This function performs regression analysis using the Michaelis-Menten model.
MM( trat, resp, npar = "mm2", sample.curve = 1000, error = "SE", ylab = "Dependent", xlab = "Independent", theme = theme_classic(), legend.position = "top", point = "all", width.bar = NA, r2 = "all", ic = FALSE, fill.ic = "gray70", alpha.ic = 0.5, textsize = 12, pointsize = 4.5, linesize = 0.8, linetype = 1, pointshape = 21, fillshape = "gray", colorline = "black", round = NA, yname.formula = "y", xname.formula = "x", comment = NA, fontfamily = "sans" )
MM( trat, resp, npar = "mm2", sample.curve = 1000, error = "SE", ylab = "Dependent", xlab = "Independent", theme = theme_classic(), legend.position = "top", point = "all", width.bar = NA, r2 = "all", ic = FALSE, fill.ic = "gray70", alpha.ic = 0.5, textsize = 12, pointsize = 4.5, linesize = 0.8, linetype = 1, pointshape = 21, fillshape = "gray", colorline = "black", round = NA, yname.formula = "y", xname.formula = "x", comment = NA, fontfamily = "sans" )
trat |
Numeric vector with dependent variable. |
resp |
Numeric vector with independent variable. |
npar |
Number of parameters (mm2 or mm3) |
sample.curve |
Provide the number of observations to simulate curvature (default is 1000) |
error |
Error bar (It can be SE - default, SD or FALSE) |
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") |
point |
defines whether you want to plot all points ("all") or only the mean ("mean") |
width.bar |
Bar width |
r2 |
coefficient of determination of the mean or all values (default is all) |
ic |
Add interval of confidence |
fill.ic |
Color interval of confidence |
alpha.ic |
confidence interval transparency level |
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 |
yname.formula |
Name of y in the equation |
xname.formula |
Name of x in the equation |
comment |
Add text after equation |
fontfamily |
Font family |
The two-parameter Michaelis-Menten model is defined by:
The three-parameter Michaelis-Menten model is defined by:
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.
Gabriel Danilo Shimizu
Seber, G. A. F. and Wild, C. J (1989) Nonlinear Regression, New York: Wiley & Sons (p. 330).
data("granada") attach(granada) MM(time,WL) MM(time,WL,npar="mm3")
data("granada") attach(granada) MM(time,WL) MM(time,WL,npar="mm3")
This function performs exponential regression analysis. This model was used by Newton.
newton( 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, yname.formula = "y", xname.formula = "x", comment = NA, fontfamily = "sans" )
newton( 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, yname.formula = "y", xname.formula = "x", 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 |
yname.formula |
Name of y in the equation |
xname.formula |
Name of x in the equation |
comment |
Add text after equation |
fontfamily |
Font family |
The exponential model is defined by:
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.
Gabriel Danilo Shimizu
Leandro Simoes Azeredo Goncalves
Seber, G. A. F. and Wild, C. J (1989) Nonlinear Regression, New York: Wiley & Sons (p. 330).
Siqueira, V. C., Resende, O., and Chaves, T. H. (2013). Mathematical modelling of the drying of jatropha fruit: an empirical comparison. Revista Ciencia Agronomica, 44, 278-285.
library(AgroReg) data("aristolochia") attach(aristolochia) newton(trat,resp+0.001)
library(AgroReg) data("aristolochia") attach(aristolochia) newton(trat,resp+0.001)
Graph for non-significant trend. Can be used within the multicurve command
Nreg( trat, resp, ylab = "Dependent", xlab = "Independent", error = "SE", theme = theme_classic(), legend.position = "top", legend.text = "not~significant", legend.add.mean = TRUE, legend.add.mean.name = "hat(y)", width.bar = NA, point = "all", textsize = 12, add.line = FALSE, add.line.mean = FALSE, linesize = 0.8, linetype = 1, pointsize = 4.5, pointshape = 21, fillshape = "gray", colorline = "black", fontfamily = "sans" )
Nreg( trat, resp, ylab = "Dependent", xlab = "Independent", error = "SE", theme = theme_classic(), legend.position = "top", legend.text = "not~significant", legend.add.mean = TRUE, legend.add.mean.name = "hat(y)", width.bar = NA, point = "all", textsize = 12, add.line = FALSE, add.line.mean = FALSE, linesize = 0.8, linetype = 1, pointsize = 4.5, pointshape = 21, fillshape = "gray", colorline = "black", fontfamily = "sans" )
trat |
Numeric vector with dependent variable. |
resp |
Numeric vector with independent variable. |
ylab |
Dependent variable name (Accepts the expression() function) |
xlab |
Independent variable name (Accepts the expression() function) |
error |
Error bar (It can be SE - default, SD or FALSE) |
theme |
ggplot2 theme (default is theme_classic()) |
legend.position |
legend position (default is "top") |
legend.text |
legend text |
legend.add.mean |
Add average in legend |
legend.add.mean.name |
Add media name |
width.bar |
Bar width |
point |
defines whether you want to plot all points ("all") or only the mean ("mean") |
textsize |
Font size |
add.line |
Add line |
add.line.mean |
Add line mean |
linesize |
line size |
linetype |
line type |
pointsize |
shape size |
pointshape |
format point (default is 21) |
fillshape |
Fill shape |
colorline |
Color lines |
fontfamily |
Font family |
The function returns an exploratory graph of segments
Gabriel Danilo Shimizu
Leandro Simoes Azeredo Goncalves
library(AgroReg) data("aristolochia") attach(aristolochia) Nreg(trat,resp)
library(AgroReg) data("aristolochia") attach(aristolochia) Nreg(trat,resp)
This function performs exponential page regression analysis.
PAGE( trat, resp, initial = NA, 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, yname.formula = "y", xname.formula = "x", comment = NA, fontfamily = "sans" )
PAGE( trat, resp, initial = NA, 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, yname.formula = "y", xname.formula = "x", comment = NA, fontfamily = "sans" )
trat |
Numeric vector with dependent variable. |
resp |
Numeric vector with independent variable. |
initial |
Starting estimates |
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 |
yname.formula |
Name of y in the equation |
xname.formula |
Name of x in the equation |
comment |
Add text after equation |
fontfamily |
Font family |
The exponential model is defined by:
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.
Gabriel Danilo Shimizu
Leandro Simoes Azeredo Goncalves
Seber, G. A. F. and Wild, C. J (1989) Nonlinear Regression, New York: Wiley & Sons (p. 330).
library(AgroReg) data("granada") attach(granada) PAGE(time,100-WL)
library(AgroReg) data("granada") attach(granada) PAGE(time,100-WL)
This function performs Peleg regression analysis.
peleg( trat, resp, initial = NA, 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, yname.formula = "y", xname.formula = "x", comment = NA, fontfamily = "sans" )
peleg( trat, resp, initial = NA, 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, yname.formula = "y", xname.formula = "x", comment = NA, fontfamily = "sans" )
trat |
Numeric vector with dependent variable. |
resp |
Numeric vector with independent variable. |
initial |
Starting estimates |
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 |
yname.formula |
Name of y in the equation |
xname.formula |
Name of x in the equation |
comment |
Add text after equation |
fontfamily |
Font family |
The Peleg model is defined by:
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.
Gabriel Danilo Shimizu
Leandro Simoes Azeredo Goncalves
Seber, G. A. F. and Wild, C. J (1989) Nonlinear Regression, New York: Wiley & Sons (p. 330).
library(AgroReg) data("granada") attach(granada) peleg(time,WL)
library(AgroReg) data("granada") attach(granada) peleg(time,WL)
This function performs the plateau-linear regression analysis.
plateau.linear( 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" )
plateau.linear( 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 plateau-linear model is defined by: First curve:
Second curve:
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); breakpoint and the graph using ggplot2 with the equation automatically.
Gabriel Danilo Shimizu
Leandro Simoes Azeredo Goncalves
Chiu, G. S., R. Lockhart, and R. Routledge. 2006. Bent-cable regression theory and applications. Journal of the American Statistical Association 101:542-553.
Toms, J. D., and M. L. Lesperance. 2003. Piecewise regression: a tool for identifying ecological thresholds. Ecology 84:2034-2041.
quadratic.plateau, linear.linear
library(AgroReg) data("granada") attach(granada) x=time[length(time):1] plateau.linear(x,WL)
library(AgroReg) data("granada") attach(granada) x=time[length(time):1] plateau.linear(x,WL)
This function performs the plateau-quadratic regression analysis.
plateau.quadratic( 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, yname.formula = "y", xname.formula = "x", comment = NA, fontfamily = "sans" ) plquadratic(x, a, breakpoint, b, c)
plateau.quadratic( 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, yname.formula = "y", xname.formula = "x", comment = NA, fontfamily = "sans" ) plquadratic(x, a, breakpoint, b, c)
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 |
yname.formula |
Name of y in the equation |
xname.formula |
Name of x in the equation |
comment |
Add text after equation |
fontfamily |
Font family |
x |
Numeric vector with dependent variable. |
a |
The plateau value |
breakpoint |
breakpoint value |
b |
Linear term |
c |
Quadratic term |
The Plateau-quadratic model is defined by:
First curve:
Second curve:
or
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.
Gabriel Danilo Shimizu
Leandro Simoes Azeredo Goncalves
Miguez, F. (2020). nlraa: nonlinear Regression for Agricultural Applications. R package version 0.65.
Chiu, G. S., R. Lockhart, and R. Routledge. 2006. Bent-cable regression theory and applications. Journal of the American Statistical Association 101:542-553.
Toms, J. D., and M. L. Lesperance. 2003. Piecewise regression: a tool for identifying ecological thresholds. Ecology 84:2034-2041.
library(AgroReg) data("granada") attach(granada) x=time[length(time):1] plateau.quadratic(x,WL)
library(AgroReg) data("granada") attach(granada) x=time[length(time):1] plateau.quadratic(x,WL)
Merge multiple curves into a single graph
plot_arrange( plots, point = "mean", theme = theme_classic(), legend.title = NULL, legend.position = "top", trat = NA, gray = FALSE, ylab = "Dependent", xlab = "Independent", widthbar = 0, pointsize = 4.5, linesize = 0.8, textsize = 12, legendsize = 12, legendtitlesize = 12, fontfamily = "sans" )
plot_arrange( plots, point = "mean", theme = theme_classic(), legend.title = NULL, legend.position = "top", trat = NA, gray = FALSE, ylab = "Dependent", xlab = "Independent", widthbar = 0, pointsize = 4.5, linesize = 0.8, textsize = 12, legendsize = 12, legendtitlesize = 12, fontfamily = "sans" )
plots |
list with objects of type analysis. |
point |
defines whether you want to plot all points ("all") or only the mean ("mean") |
theme |
ggplot2 theme (default is theme_classic()) |
legend.title |
caption title |
legend.position |
legend position (default is c(0.3,0.8)) |
trat |
name of the curves |
gray |
gray scale (default is FALSE) |
ylab |
Variable response name (Accepts the expression() function) |
xlab |
treatments name (Accepts the expression() function) |
widthbar |
bar width (default is 0.3) |
pointsize |
shape size |
linesize |
line size |
textsize |
Font size |
legendsize |
Legend size text |
legendtitlesize |
Title legend size |
fontfamily |
font family |
The function returns a graph joining the outputs of the functions LM_model, LL_model, BC_model, CD_model, loess_model, normal_model, piecewise_model and N_model
Gabriel Danilo Shimizu
library(AgroReg) library(ggplot2) data("aristolochia") attach(aristolochia) a=LM(trat,resp) b=LL(trat,resp,npar = "LL.3") plot_arrange(list(a,b)) models <- c("LM1", "LL3") r <- lapply(models, function(x) { r <- with(granada, regression(time, WL, model = x)) }) plot_arrange(r,trat=models,ylab="WL (%)",xlab="Time (Minutes)") models = c("asymptotic_neg", "biexponential", "LL4", "BC4", "CD5", "linear.linear", "linear.plateau", "quadratic.plateau", "mitscherlich", "MM2") m = lapply(models, function(x) { m = with(granada, regression(time, WL, model = x))}) plot_arrange(m, trat = paste("(",models,")"))
library(AgroReg) library(ggplot2) data("aristolochia") attach(aristolochia) a=LM(trat,resp) b=LL(trat,resp,npar = "LL.3") plot_arrange(list(a,b)) models <- c("LM1", "LL3") r <- lapply(models, function(x) { r <- with(granada, regression(time, WL, model = x)) }) plot_arrange(r,trat=models,ylab="WL (%)",xlab="Time (Minutes)") models = c("asymptotic_neg", "biexponential", "LL4", "BC4", "CD5", "linear.linear", "linear.plateau", "quadratic.plateau", "mitscherlich", "MM2") m = lapply(models, function(x) { m = with(granada, regression(time, WL, model = x))}) plot_arrange(m, trat = paste("(",models,")"))
This function performs potencial regression analysis.
potential( 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, yname.formula = "y", xname.formula = "x", comment = NA, fontfamily = "sans" )
potential( 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, yname.formula = "y", xname.formula = "x", 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 |
yname.formula |
Name of y in the equation |
xname.formula |
Name of x in the equation |
comment |
Add text after equation |
fontfamily |
Font family |
The exponential model is defined by:
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.
Gabriel Danilo Shimizu
Leandro Simoes Azeredo Goncalves
Seber, G. A. F. and Wild, C. J (1989) Nonlinear Regression, New York: Wiley & Sons (p. 330).
Siqueira, V. C., Resende, O., & Chaves, T. H. (2013). Mathematical modelling of the drying of jatropha fruit: an empirical comparison. Revista Ciencia Agronomica, 44, 278-285.
library(AgroReg) data("granada") attach(granada) potential(time,WL)
library(AgroReg) data("granada") attach(granada) potential(time,WL)
This function performs the quadratic-plateau regression analysis.
quadratic.plateau( 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, yname.formula = "y", xname.formula = "x", comment = NA, fontfamily = "sans" )
quadratic.plateau( 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, yname.formula = "y", xname.formula = "x", 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 |
yname.formula |
Name of y in the equation |
xname.formula |
Name of x in the equation |
comment |
Add text after equation |
fontfamily |
Font family |
The quadratic-plateau model is defined by:
First curve:
Second curve:
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.
Gabriel Danilo Shimizu
Leandro Simoes Azeredo Goncalves
Chiu, G. S., R. Lockhart, and R. Routledge. 2006. Bent-cable regression theory and applications. Journal of the American Statistical Association 101:542-553.
Toms, J. D., and M. L. Lesperance. 2003. Piecewise regression: a tool for identifying ecological thresholds. Ecology 84:2034-2041.
library(AgroReg) data("granada") attach(granada) quadratic.plateau(time,WL)
library(AgroReg) data("granada") attach(granada) quadratic.plateau(time,WL)
This function is a simplification of all the analysis functions present in the package.
regression( trat, resp, model = "LM1", ylab = "Dependent", xlab = "Independent", theme = theme_classic(), legend.position = "top", point = "all", textsize = 12, pointsize = 4.5, linesize = 0.8, pointshape = 21, round = NA, fontfamily = "sans", error = "SE", width.bar = NA, xname.formula = "x", yname.formula = "y" )
regression( trat, resp, model = "LM1", ylab = "Dependent", xlab = "Independent", theme = theme_classic(), legend.position = "top", point = "all", textsize = 12, pointsize = 4.5, linesize = 0.8, pointshape = 21, round = NA, fontfamily = "sans", error = "SE", width.bar = NA, xname.formula = "x", yname.formula = "y" )
trat |
Numeric vector with dependent variable. |
resp |
Numeric vector with independent variable. |
model |
model regression (default is LM1) |
ylab |
Variable response name (Accepts the expression() function) |
xlab |
treatments name (Accepts the expression() function) |
theme |
ggplot2 theme (default is theme_classic()) |
legend.position |
legend position (default is c(0.3,0.8)) |
point |
defines whether you want to plot all points ("all") or only the mean ("mean") |
textsize |
Font size |
pointsize |
shape size |
linesize |
line size |
pointshape |
format point (default is 21) |
round |
round equation |
fontfamily |
Font family |
error |
Error bar (It can be SE - default, SD or FALSE) |
width.bar |
Bar width |
xname.formula |
Name of x in the equation |
yname.formula |
Name of y in the equation |
To change the regression model, change the "model" argument to:
N: Graph for not significant trend.
loess0: Loess non-parametric degree 0
loess1: Loess non-parametric degree 1
loess2: Loess non-parametric degree 2
LM0.5: Quadratic inverse
LM1: Linear regression.
LM2: Quadratic
LM3: Cubic
LM4: Quartic
LM0.5_i: Quadratic inverse without intercept.
LM1_i: Linear without intercept.
LM2_i: Quadratic regression without intercept.
LM3_i: Cubic without intercept.
LM4_i: Quartic without intercept.
LM13: Cubic without beta2
LM13i: Cubic inverse without beta2
LM23: Cubic without beta1
LM23i: Cubic inverse without beta2
LM2i3: Cubic without beta1, with inverse beta3
valcam: Valcam
L3: Three-parameter logistics.
L4: Four-parameter logistics.
L5: Five-parameter logistics.
LL3: Three-parameter log-logistics.
LL4: Four-parameter log-logistics.
LL5: Five-parameter log-logistics.
BC4: Brain-Cousens with four parameter.
BC5: Brain-Cousens with five parameter.
CD4: Cedergreen-Ritz-Streibig with four parameter.
CD5: Cedergreen-Ritz-Streibig with five parameter.
weibull3: Weibull with three parameter.
weibull4: Weibull with four parameter.
GP2: Gompertz with two parameter.
GP3: Gompertz with three parameter.
GP4: Gompertz with four parameter.
VB: Von Bertalanffy
lo3: Lorentz with three parameter
lo4: Lorentz with four parameter
beta: Beta
gaussian3: Analogous to the Gaussian model/Bragg with three parameters.
gaussian4: Analogous to the Gaussian model/Bragg with four parameters.
linear.linear: Linear-linear
linear.plateau: Linear-plateau
quadratic.plateau: Quadratic-plateau
plateau.linear: Plateau-linear
plateau.quadratic: Plateau-Quadratic
log: Logarithmic
log2: Logarithmic quadratic
thompson: Thompson
asymptotic: Exponential
asymptotic_neg: Exponential negative
asymptotic_i: Exponential without intercept.
asymptotic_ineg: Exponential negative without intercept.
biexponential: Biexponential
mitscherlich: Mitscherlich
yieldloss: Yield-loss
hill: Hill
MM2: Michaelis-Menten with two parameter.
MM3: Michaelis-Menten with three parameter.
SH: Steinhart-Hart
page: Page
newton: Newton
potential: Potential
midilli: Midilli
midillim: Modified Midilli
AM: Avhad and Marchetti
peleg: Peleg
VG: Vega-Galvez
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.
library(AgroReg) data("aristolochia") attach(aristolochia) regression(trat, resp)
library(AgroReg) data("aristolochia") attach(aristolochia) regression(trat, resp)
The Steinhart-Hart model. The Steinhart-Hart equation is a model used to explain the behavior of a semiconductor at different temperatures, however, Zhai et al. (2020) used this model to relate plant density and grain yield.
SH( trat, resp, initial = NA, sample.curve = 1000, ylab = "Dependent", xlab = "Independent", theme = theme_classic(), legend.position = "top", r2 = "all", error = "SE", 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, yname.formula = "y", xname.formula = "x", comment = NA, fontfamily = "sans" )
SH( trat, resp, initial = NA, sample.curve = 1000, ylab = "Dependent", xlab = "Independent", theme = theme_classic(), legend.position = "top", r2 = "all", error = "SE", 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, yname.formula = "y", xname.formula = "x", comment = NA, fontfamily = "sans" )
trat |
Numeric vector with dependent variable. |
resp |
Numeric vector with independent variable. |
initial |
Starting estimates |
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") |
r2 |
Coefficient of determination of the mean or all values (default is all) |
error |
Error bar (It can be SE - default, SD or FALSE) |
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 |
yname.formula |
Name of y in the equation |
xname.formula |
Name of x in the equation |
comment |
Add text after equation |
fontfamily |
Font family |
The model function for the Steinhart-Hart model is:
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.
Gabriel Danilo Shimizu
Leandro Simoes Azeredo Goncalves
Zhai, L., Li, H., Song, S., Zhai, L., Ming, B., Li, S., ... & Zhang, L. (2021). Intra-specific competition affects the density tolerance and grain yield of maize hybrids. Agronomy Journal, 113(1), 224-23. doi:10.1002/agj2.20438
library(AgroReg) data("aristolochia") attach(aristolochia) SH(trat,resp)
library(AgroReg) data("aristolochia") attach(aristolochia) SH(trat,resp)
This function calculates other statistical parameters such as Mean (Bias) Error, Relative Mean (Bias) Error, Mean Absolute Error, Relative Mean Absolute Error, Root Mean Square Error, Relative Root Mean Square Error, Modeling Efficiency, Standard deviation of differences, Coefficient of Residual Mass.
stat_param(models, names_model = NA, round = 3)
stat_param(models, names_model = NA, round = 3)
models |
List with objects of type analysis |
names_model |
Names of the models |
round |
Round numbers |
Returns a table with the statistical parameters for choosing the model.
Gabriel Danilo Shimizu
library(AgroReg) data(granada) attach(granada) a=LM(time,WL) b=LL(time,WL) c=BC(time,WL) d=weibull(time,WL) stat_param(models=list(a,b,c,d))
library(AgroReg) data(granada) attach(granada) a=LM(time,WL) b=LL(time,WL) c=BC(time,WL) d=weibull(time,WL) stat_param(models=list(a,b,c,d))
This function performs Thompson regression analysis.
thompson( 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, yname.formula = "y", xname.formula = "x", comment = NA, fontfamily = "sans" )
thompson( 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, yname.formula = "y", xname.formula = "x", 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 c(0.3,0.8)) |
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 |
yname.formula |
Name of y in the equation |
xname.formula |
Name of x in the equation |
comment |
Add text after equation |
fontfamily |
Font family |
The logarithmic model is defined by:
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.
Gabriel Danilo Shimizu
Leandro Simoes Azeredo Goncalves
Seber, G. A. F. and Wild, C. J (1989) Nonlinear Regression, New York: Wiley & Sons (p. 330).
Sadeghi, E., Haghighi Asl, A., & Movagharnejad, K. (2019). Mathematical modelling of infrared-dried kiwifruit slices under natural and forced convection. Food science & nutrition, 7(11), 3589-3606.
library(AgroReg) resp=c(10,8,6.8,6,5,4.3,4.1,4.2,4.1) trat=seq(1,9,1) thompson(trat,resp)
library(AgroReg) resp=c(10,8,6.8,6,5,4.3,4.1,4.2,4.1) trat=seq(1,9,1) thompson(trat,resp)
This function performs Valcam regression analysis.
valcam( trat, resp, sample.curve = 1000, error = "SE", ylab = "Dependent", xlab = "Independent", theme = theme_classic(), legend.position = "top", r2 = "mean", 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, yname.formula = "y", xname.formula = "x", comment = NA, fontfamily = "sans" )
valcam( trat, resp, sample.curve = 1000, error = "SE", ylab = "Dependent", xlab = "Independent", theme = theme_classic(), legend.position = "top", r2 = "mean", 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, yname.formula = "y", xname.formula = "x", 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) |
error |
Error bar (It can be SE - default, SD or FALSE) |
ylab |
Dependent variable name (Accepts the expression() function) |
xlab |
Independent variable name (Accepts the expression() function) |
theme |
ggplot2 theme (default is theme_classic()) |
legend.position |
legend position (default is "top") |
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 |
yname.formula |
Name of y in the equation |
xname.formula |
Name of x in the equation |
comment |
Add text after equation |
fontfamily |
Font family |
The Valcam model is defined by:
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.
Gabriel Danilo Shimizu
Leandro Simoes Azeredo Goncalves
Siqueira, V. C., Resende, O., & Chaves, T. H. (2013). Mathematical modelling of the drying of jatropha fruit: an empirical comparison. Revista Ciencia Agronomica, 44, 278-285.
library(AgroReg) data("aristolochia") attach(aristolochia) valcam(trat,resp)
library(AgroReg) data("aristolochia") attach(aristolochia) valcam(trat,resp)
The Von Bertalanffy model. It's a kind of growth curve for a time series and takes its name from its creator, Ludwig von Bertalanffy. It is a special case of the generalized logistic function. The growth curve (biology) is used to model the average length from age in animals.
VB( trat, resp, initial = NA, sample.curve = 1000, ylab = "Dependent", xlab = "Independent", theme = theme_classic(), legend.position = "top", r2 = "all", error = "SE", 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, yname.formula = "y", xname.formula = "x", comment = NA, fontfamily = "sans" )
VB( trat, resp, initial = NA, sample.curve = 1000, ylab = "Dependent", xlab = "Independent", theme = theme_classic(), legend.position = "top", r2 = "all", error = "SE", 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, yname.formula = "y", xname.formula = "x", comment = NA, fontfamily = "sans" )
trat |
Numeric vector with dependent variable. |
resp |
Numeric vector with independent variable. |
initial |
Starting estimates |
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") |
r2 |
Coefficient of determination of the mean or all values (default is all) |
error |
Error bar (It can be SE - default, SD or FALSE) |
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 |
yname.formula |
Name of y in the equation |
xname.formula |
Name of x in the equation |
comment |
Add text after equation |
fontfamily |
Font family |
The model function for the von Bertalanffy model is:
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.
Gabriel Danilo Shimizu
Leandro Simoes Azeredo Goncalves
library(AgroReg) x=seq(1,20) y=c(0.10, 0.20, 0.30, 0.40, 0.50, 0.60, 0.70, 0.80, 0.90, 0.91, 0.92, 0.94, 0.96, 0.98, 1.00, 1.00, 1.00, 1.00, 1.00, 1.00) VB(x,y)
library(AgroReg) x=seq(1,20) y=c(0.10, 0.20, 0.30, 0.40, 0.50, 0.60, 0.70, 0.80, 0.90, 0.91, 0.92, 0.94, 0.96, 0.98, 1.00, 1.00, 1.00, 1.00, 1.00, 1.00) VB(x,y)
This function performs Vega-Galvez regression analysis.
VG( trat, resp, sample.curve = 1000, error = "SE", ylab = "Dependent", xlab = "Independent", theme = theme_classic(), legend.position = "top", r2 = "mean", 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, yname.formula = "y", xname.formula = "x", comment = NA, fontfamily = "sans" )
VG( trat, resp, sample.curve = 1000, error = "SE", ylab = "Dependent", xlab = "Independent", theme = theme_classic(), legend.position = "top", r2 = "mean", 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, yname.formula = "y", xname.formula = "x", 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) |
error |
Error bar (It can be SE - default, SD or FALSE) |
ylab |
Dependent variable name (Accepts the expression() function) |
xlab |
Independent variable name (Accepts the expression() function) |
theme |
ggplot2 theme (default is theme_classic()) |
legend.position |
legend position (default is "top") |
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 |
yname.formula |
Name of y in the equation |
xname.formula |
Name of x in the equation |
comment |
Add text after equation |
fontfamily |
Font family |
The Vega-Galvez model is defined by:
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.
Gabriel Danilo Shimizu
Leandro Simoes Azeredo Goncalves
Sadeghi, E., Haghighi Asl, A., and Movagharnejad, K. (2019). Mathematical modelling of infrared-dried kiwifruit slices under natural and forced convection. Food science & nutrition, 7(11), 3589-3606.
library(AgroReg) data("aristolochia") attach(aristolochia) VG(trat,resp)
library(AgroReg) data("aristolochia") attach(aristolochia) VG(trat,resp)
The w3' and 'w4' logistical models provide Weibull. This model was extracted from the 'drc' package.
weibull( trat, resp, npar = "w3", sample.curve = 1000, ylab = "Dependent", xlab = "Independent", theme = theme_classic(), legend.position = "top", r2 = "all", ic = FALSE, fill.ic = "gray70", alpha.ic = 0.5, error = "SE", 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, yname.formula = "y", xname.formula = "x", comment = NA, fontfamily = "sans" )
weibull( trat, resp, npar = "w3", sample.curve = 1000, ylab = "Dependent", xlab = "Independent", theme = theme_classic(), legend.position = "top", r2 = "all", ic = FALSE, fill.ic = "gray70", alpha.ic = 0.5, error = "SE", 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, yname.formula = "y", xname.formula = "x", comment = NA, fontfamily = "sans" )
trat |
Numeric vector with dependent variable. |
resp |
Numeric vector with independent variable. |
npar |
Number of model parameters (default is w3) |
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") |
r2 |
Coefficient of determination of the mean or all values (default is all) |
ic |
Add interval of confidence |
fill.ic |
Color interval of confidence |
alpha.ic |
confidence interval transparency level |
error |
Error bar (It can be SE - default, SD or FALSE) |
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 |
yname.formula |
Name of y in the equation |
xname.formula |
Name of x in the equation |
comment |
Add text after equation |
fontfamily |
Font family |
The three-parameter Weibull model is given by the expression
Fixing the lower limit at 0 yields the four-parameter model
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 drc package (Ritz et al., 2016)
Gabriel Danilo Shimizu
Leandro Simoes Azeredo Goncalves
Seber, G. A. F. and Wild, C. J (1989) Nonlinear Regression, New York: Wiley & Sons (p. 330).
Ritz, C.; Strebig, J.C. and Ritz, M.C. Package ‘drc’. Creative Commons: Mountain View, CA, USA, 2016.
library(AgroReg) data("aristolochia") attach(aristolochia) weibull(trat,resp)
library(AgroReg) data("aristolochia") attach(aristolochia) weibull(trat,resp)
This function performs regression analysis using the Yield loss model.
yieldloss( trat, resp, sample.curve = 1000, error = "SE", ylab = "Dependent", xlab = "Independent", theme = theme_classic(), legend.position = "top", point = "all", width.bar = NA, r2 = "all", textsize = 12, pointsize = 4.5, linesize = 0.8, linetype = 1, pointshape = 21, fillshape = "gray", colorline = "black", round = NA, yname.formula = "y", xname.formula = "x", comment = NA, scale = "none", fontfamily = "sans" )
yieldloss( trat, resp, sample.curve = 1000, error = "SE", ylab = "Dependent", xlab = "Independent", theme = theme_classic(), legend.position = "top", point = "all", width.bar = NA, r2 = "all", textsize = 12, pointsize = 4.5, linesize = 0.8, linetype = 1, pointshape = 21, fillshape = "gray", colorline = "black", round = NA, yname.formula = "y", xname.formula = "x", comment = NA, scale = "none", 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) |
error |
Error bar (It can be SE - default, SD or FALSE) |
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") |
point |
defines whether you want to plot all points ("all") or only the mean ("mean") |
width.bar |
Bar width |
r2 |
coefficient of determination of the mean or all values (default is all) |
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 |
yname.formula |
Name of y in the equation |
xname.formula |
Name of x in the equation |
comment |
Add text after equation |
scale |
Sets x scale (default is none, can be "log") |
fontfamily |
Font family |
The Yield Loss model is defined by:
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 (Onofri, 2020)
Gabriel Danilo Shimizu
Seber, G. A. F. and Wild, C. J (1989) Nonlinear Regression, New York: Wiley & Sons (p. 330).
Onofri A. (2020) The broken bridge between biologists and statisticians: a blog and R package, Statforbiology, IT, web: https://www.statforbiology.com
data("granada") attach(granada) yieldloss(time,WL)
data("granada") attach(granada) yieldloss(time,WL)