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"
)
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.
Numeric vector with dependent variable.
Numeric vector with independent variable.
Provide the number of observations to simulate curvature (default is 1000)
Variable response name (Accepts the expression() function)
treatments name (Accepts the expression() function)
ggplot2 theme (default is theme_bw())
legend position (default is "top")
Error bar (It can be SE - default, SD or FALSE)
coefficient of determination of the mean or all values (default is all)
defines whether you want to plot all points ("all") or only the mean ("mean")
Bar width
Sets x scale (default is none, can be "log")
Font size
shape size
line size
line type
format point (default is 21)
Fill shape
Color lines
round equation
Name of x in the equation
Name of y in the equation
Add text after equation
Font family
Gabriel Danilo Shimizu
Leandro Simoes Azeredo Goncalves
The plateau-linear model is defined by: First curve: $$y = \beta_0 + \beta_1 \times breakpoint (x < breakpoint)$$
Second curve: $$y = \beta_0 + \beta_1 \times x (x > breakpoint)$$
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)
Run the code above in your browser using DataLab