Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- library("MASS")
- data(faithful)
- str(faithful)
- dt <- faithful[c("eruptions","waiting")]
- summary(dt)
- with(dt,plot(eruptions ~ waiting))
- with(dt,cor(eruptions,waiting))
- with(dt,cor(eruptions,waiting)^2)
- model <- lm(formula = eruptions ~ waiting, data = faithful)
- summary(model)
- boxplot(eruptions ~ waiting,data = dt, xlab="Waiting", ylab="Eruptions")
- resid <- rstandard(model)
- qqnorm(resid, ylab="Standardized Residuals",
- xlab="Normal Scores", main="Eruptions")
- qqline(resid)
- sisaan <- resid(model)
- plot(dt$eruptions, sisaan, ylab="Residuals",
- xlab="Eruptions", main="Plot Sisaan")
- abline(0,0)
- nrow(faithful)
- plot(1:272, sisaan, ylab="Residuals")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement