inst/snippet/lm-simulate1.R

b0 <- 3; b1 <- 5; sigma <- 2       # set model parameters
x <- rep(1:5,each=4)               # 4 observations at each of 5 values
e <- rnorm(length(x),sd=sigma)     # error term in the model
y <- b0 + b1*x + e                 # build response according to model
###hop:3-9
model <- lm(y~x); summary(model)
confint(model)

Try the fastR package in your browser

Any scripts or data that you put into this service are public.

fastR documentation built on May 2, 2019, 5:53 p.m.