plateau.quadratic {AgroReg} | R Documentation |
Analysis: Plateau-quadratic
Description
This function performs the plateau-quadratic regression analysis.
Usage
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)
Arguments
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 |
Details
The Plateau-quadratic model is defined by:
First curve:
y = \beta_0 + \beta_1 \cdot breakpoint + \beta_2 \cdot breakpoint^2 (x < breakpoint)
Second curve:
y = \beta_0 + \beta_1 \cdot x + \beta_2 \cdot x^2 (x > breakpoint)
or
y = a + b(x+breakpoint) + c(x+breakpoint)^2 (x > breakpoint)
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.
Author(s)
Gabriel Danilo Shimizu
Leandro Simoes Azeredo Goncalves
References
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.
See Also
Examples
library(AgroReg)
data("granada")
attach(granada)
x=time[length(time):1]
plateau.quadratic(x,WL)