Created
August 20, 2014 14:28
-
-
Save sachsmc/fda939cb70ff7ac5d5b6 to your computer and use it in GitHub Desktop.
frequentist approach
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## frequentist approach for comparison | |
freq_leaveout <- function(formula) { | |
leftout <- sapply(1:n.trials, function(i){ | |
fit.biv <- lm(formula, data = hat.test[-i, ]) | |
predict(fit.biv, newdata = hat.test)[i] | |
}) | |
full <- predict(lm(formula, data = hat.test)) | |
list(leftout = leftout, full = full) | |
} | |
freq.summary <- list(a = freq_leaveout(T2.hat ~ T1.a.hat), | |
b = freq_leaveout(T2.hat ~ T1.b.hat), | |
biv = freq_leaveout(T2.hat ~ T1.a.hat + T1.b.hat)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment