demo/cs25.r

data (course.df)
pairs20x(course.df[c(3,7,8,14)])
exam.fit<-lm(Exam~Assign+Test+Stage1+Gender+Attend+Years.Since+Repeat+Degree,data=course.df)
eovcheck(exam.fit)
plot(exam.fit,which=1)
summary(exam.fit)
anova(exam.fit)
exam.fit1<-lm(Exam~Assign+Test+Stage1+Gender+Attend+Years.Since+Repeat,data=course.df)
summary(exam.fit1)
exam.fit2<-lm(Exam~Assign+Test+Stage1+Gender+Attend+Repeat,data=course.df)
summary(exam.fit2)
exam.fit3<-lm(Exam~Assign+Test+Stage1+Attend+Repeat,data=course.df)
summary(exam.fit3)
exam.fit4<-lm(Exam~Assign+Test+Stage1+Repeat, data=course.df)
summary(exam.fit4)
exam.fit5<-lm(Exam~Assign+Test+Stage1,data=course.df)
summary(exam.fit5)
plot(exam.fit5,which=1)
layout20x(1,2)
plot(residuals(exam.fit5)~Assign,main="Residual plot (Assign)",data=course.df)
lines(lowess(course.df$Assign,residuals(exam.fit5)))
plot(residuals(exam.fit5)~Test,main="Residual plot (Test)",data=course.df)
lines(lowess(course.df$Test,residuals(exam.fit5)))
layout20x(1,1)
exam.fit6<-lm(Exam~Assign+Test+I(Test^2)+Stage1,data=course.df)
summary(exam.fit6)
plot(exam.fit6,which=1)
cooks20x(exam.fit6)
course.df[106,]
course.df<-within(course.df,{obs<-1:146})
plot(Test~Assign,type="n",main="Test versus Assign",data=course.df)
text(course.df$Assign,course.df$Test,course.df$obs)
exam.fit7<-lm(Exam~Assign+Test+I(Test^2)+Stage1,data=course.df[-106,])
summary(exam.fit7)
summary(exam.fit6)
normcheck(exam.fit6)
ciReg(exam.fit6)
course.df<-within(course.df,{Stage1B.<-factor(Stage1,levels=c("B","C","A"))})
exam.fit6a<-lm(Exam~Assign+Test+I(Test^2)+Stage1B.,data=course.df)
summary(exam.fit6a)
ciReg(exam.fit6a)
test<-seq(4,20,by=0.01)
exam<- -1.2472*test+(0.13846*(test^2))
plot(exam~test,type="l",main="Exam versus Test",xlab="test",ylab="exam")

Try the s20x package in your browser

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

s20x documentation built on Aug. 21, 2023, 5:07 p.m.