regression {AgroReg} | R Documentation |
Analysis: Regression linear or nonlinear
Description
This function is a simplification of all the analysis functions present in the package.
Usage
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"
)
Arguments
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 |
Details
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
Value
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.
Examples
library(AgroReg)
data("aristolochia")
attach(aristolochia)
regression(trat, resp)