Description Usage Arguments Value Note Author(s) References Examples
Fit a degree 1 spline with 1 knot point where the location of the knot point is unknown.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | piecewise_model(
trat,
resp,
middle = 1,
CI = FALSE,
bootstrap.samples = 1000,
sig.level = 0.05,
error = "SE",
ylab = "Germination (%)",
xlab = expression("Temperature ("^"o" * "C)"),
theme = theme_classic(),
cardinal = 0,
legend.position = "top"
)
|
trat |
Numerical or complex vector with treatments |
resp |
Numerical vector containing the response of the experiment. |
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()) |
cardinal |
defines the value of y considered extreme (default considers 0 germination) |
legend.position |
legend position (default is c(0.3,0.8)) |
The function returns the coefficients and respective p-values; statistical parameters such as AIC, BIC, pseudo-R2; cardinal and optimal temperatures and the graph using ggplot2 with the equation.
if the maximum predicted value is equal to the maximum x, the curve does not have a maximum point within the studied range. If the minimum value is less than the lowest point studied, disregard the value.
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.
1 2 3 4 | library(seedreg)
data("aristolochia")
attach(aristolochia)
piecewise_model(trat,resp)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.