H Kelsey,
Here is one way:
# some data
set.seed(123)
x <- rnorm(100)
e <- rexp(100, 2)
y <- 3 + 1.5*x - 1.3*x^2 + e
plot(x, y, las = 1)
d <- data.frame(x, y)
d
# model
fit <- lm(y ~ x + I(x^2) , data = d)
summary(fit)
rse <- summary(fit)$sigma
rse
# [1] 0.4646164
# function to calculate the RSE
Hello,
I am trying to write a code to estimate the residual standard error and create
a confidence interval using bootstrap, since it does not follow a normal
distribution.
So far I have found a linear model for the data (m1<-lm(y~x+I(x^2))), but I am
not sure how to create the bootstrap code
2 matches
Mail list logo