Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- dummy <- df(y, x, a, b, who)
- who <- c("Joseph", "Kim", "Billy")
- function() {
- ols.reg.Billy <- lm(y ~ x + a + b, data = dummy[dummy$who == "Billy"])
- dw.Billy <- dwtest(ols.reg.Billy)
- output.Billy <- list(ols.reg.Billy, dw.Billy)
- return(output.Billy)
- }
- outputs <- lapply (whos, function(name) {
- ols.reg <- lm(y ~ x + a + b, data = dummy[dummy$who == name])
- dw <- dwtest(ols.reg)
- return(list(ols.reg, dw))
- })
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement