Open englianhu opened 4 years ago
Extending the linear model with R.pdf
https://github.com/englianhu/report/issues/9#issue-733422198 here i tried to build random effects while noticed doesn't enhance my model.
#degree = 2
mm000 = lm(Profit ~ Date *
poly(Bettor, degree = 2, raw = FALSE) *
poly(Won, degree = 2, raw = FALSE) *
poly(Cancelled, degree = 2, raw = FALSE) *
poly(Rebates, degree = 2, raw = FALSE) *
(1 + Won * Cancelled | Bettor) * (Type / Date), smp2) %>%
extractAIC
mm001 = lm(Profit ~ Date *
poly(Bettor, degree = 2, raw = FALSE) *
poly(Won, degree = 2, raw = FALSE) *
poly(Cancelled, degree = 2, raw = FALSE) *
poly(Rebates, degree = 2, raw = FALSE) *
(1 + Won * Cancelled / Bettor) * (Type / Date), smp2) %>%
extractAIC
#degree = 3
mm002 = lm(Profit ~ Date *
poly(Bettor, degree = 3, raw = FALSE) *
poly(Won, degree = 3, raw = FALSE) *
poly(Cancelled, degree = 3, raw = FALSE) *
poly(Rebates, degree = 3, raw = FALSE) *
(1 + Won * Cancelled | Bettor) * (Type / Date), smp2) %>%
extractAIC
mm003 = lm(Profit ~ Date *
poly(Bettor, degree = 3, raw = FALSE) *
poly(Won, degree = 3, raw = FALSE) *
poly(Cancelled, degree = 3, raw = FALSE) *
poly(Rebates, degree = 3, raw = FALSE) *
(1 + Won * Cancelled / Bettor) * (Type / Date), smp2) %>%
extractAIC
Explanation on random effects & nested lm via randomeffs2.pdf
[问答]求Statistical Computing with R 客课后答案
Pdf电子书:https://englianhu.files.wordpress.com/2020/10/statistical-computer-with-r-2nd-edition.pdf