set.seed(42)
x <- seq(from=0, to=20, by=0.1)
y <- (500 + 0.4 * (x-10)^3)
noise <- y + rnorm(length(x), mean=10, sd=80)
p <- poly_trend(x, noise, degree = 3, ci = 0.95,
main="3rd degree polynomial")
dev.new(height=6, width=12)
layout(matrix(c(1,2), 1, 2, byrow = TRUE))
p <- poly_trend(x, noise, degree = 3,
main="3rd degree polynomial")
p <- poly_trend(x, noise, degree = 6,
main="6th degree polynomial")
cat("Confidence intervals for", "1 -", p$order, "polynomials", "\n")
p$prameterCI
Run the code above in your browser using DataLab