sandbox/Shubhankit/sandbox/Week6-7/Code/Tests/Tests.R

fpe <- read.table("http://data.princeton.edu/wws509/datasets/effort.dat")
attach(fpe)
lmfit = lm( change ~ setting + effort )
sandwich(lmfit)
Fr <- c(68,42,42,30, 37,52,24,43,
        66,50,33,23, 47,55,23,47,
        63,53,29,27, 57,49,19,29)

Temp <- gl(2, 2, 24, labels = c("Low", "High"))
Soft <- gl(3, 8, 24, labels = c("Hard","Medium","Soft"))
M.user <- gl(2, 4, 24, labels = c("N", "Y"))
Brand <- gl(2, 1, 24, labels = c("X", "M"))

detg <- data.frame(Fr,Temp, Soft,M.user, Brand)
detg.m0 <- glm(Fr ~ M.user*Temp*Soft + Brand, family = poisson, data = detg)
summary(detg.m0)

detg.mod <- glm(terms(Fr ~ M.user*Temp*Soft + Brand*M.user*Temp,
                      keep.order = TRUE),
                family = poisson, data = detg)
sandwich(detg.mod)
cloudcell/PerformanceAnalytics documentation built on May 13, 2019, 8:01 p.m.