(work in progress)

Introduction

Purposes of this report include:

Data Setup

dpor=as.data.frame(read.table("student-por.csv",sep=";",header=TRUE))
dmath=as.data.frame(read.table("student-mat.csv",sep=";",header=TRUE))
dmerge=merge(dpor,dmath,by=c("school","sex","age","address","famsize","Pstatus","Medu","Fedu","Mjob","Fjob","reason","nursery","internet"))
dpor1 <- subset(subset(dpor, school=="GP"),select=-school)
dpor2 <- subset(subset(dpor, school=="MS"),select=-school)
dmath1 <- subset(dmath, school=="GP")
dmath2 <- subset(dmath, school == "MS")

Descriptive Statistics

T Tests, Effect Sizes, Confidence Intervals

One-Way ANOVA, Two-Way ANOVA, ANCOVA, MANOVA Post Hoc Comparisons/Tukey Honest Significant Difference Tests

Linear Regression, Scatterplots

Multiple Regression, Generalized Linear Models, Model Comparisons

What proportion of the varience in students’ final grades can be explained by the following variables:

#lm <- lm(G3 ~ . -G1 -G2, data=dpor1)
summary(lm)
layout(matrix(c(1,2,3,4),2,2))
plot(lm)

library(MASS)
steplm <- stepAIC(lm, direction="both")
summary(steplm)

steplm <- lm(G3 ~ sex + age + Mjob + Fjob + studytime + failures + 
               schoolsup + activities + higher + romantic + goout + health + 
               absences, data = dpor1)
summary(steplm)
steplmInt <- lm(G3 ~ (sex + age + Mjob + Fjob + studytime + failures + 
               schoolsup + activities + higher + romantic + goout + health + 
               absences)^2, data = dpor1)

steplmIntStep <- stepAIC(steplmInt, direction="both")
summary(steplmIntStep)
AIC(lm, steplm, steplmInt, steplmIntStep)

library(relaimpo)
calc.relimp(steplm, type=c("lmg"),rela=TRUE, rank=TRUE)

dpor1$failures <- ifelse(dpor1$failures >0, 1, 0)
table(dpor1$failures)

glm <- glm(failures ~ . -G1 -G2 -G3, data=dpor1, family=binomial())
summary(glm)
library(MASS)
glmstep <- stepAIC(glm, direction="both")
summary(glmstep)
glmstepInt <- glm(failures ~ (age + famsize + Medu + reason + studytime + 
                    schoolsup + paid + higher + absences)^2, family = binomial(), 
                  data = dpor1)
summary(glmstepInt)
glmstepIntStep <- stepAIC(glmstepInt, direciton="both")
AIC(glm, glmstep, glmstepInt, glmstepIntStep)

Mixed Effect/Hierarchical/Multilevel Modeling

Principal Components Analysis, Exploratory Factor Analysis

Confirmatory Factor Analysis, Structural Equation Modeling