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"
)
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.
Numeric vector with dependent variable.
Numeric vector with independent variable.
degree of the polynomial (0.5, 1, 2, 3 or 4)
Provide the number of observations to simulate curvature (default is 1000)
Dependent variable name (Accepts the expression() function)
Independent variable name (Accepts the expression() function)
Error bar (It can be SE - default, SD or FALSE)
Add interval of confidence
Color interval of confidence
confidence interval transparency level
defines whether you want to plot all points ("all") or only the mean ("mean")
coefficient of determination of the mean or all values (default is all)
ggplot2 theme (default is theme_classic())
legend position (default is "top")
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 linear model is defined by: $$y = \beta_0 + \beta_1\cdot x$$ The quadratic model is defined by: $$y = \beta_0 + \beta_1\cdot x + \beta_2\cdot x^2$$ The quadratic inverse model is defined by: $$y = \beta_0 + \beta_1\cdot x + \beta_2\cdot x^{0.5}$$ The cubic model is defined by: $$y = \beta_0 + \beta_1\cdot x + \beta_2\cdot x^2 + \beta_3\cdot x^3$$ The quartic model is defined by: $$y = \beta_0 + \beta_1\cdot x + \beta_2\cdot x^2 + \beta_3\cdot x^3+ \beta_4\cdot x^4$$
library(AgroReg)
data("aristolochia")
attach(aristolochia)
LM(trat,resp, degree = 3)
Run the code above in your browser using DataLab