Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Statistical Computing with R (2nd Edition).pdf #8

Open
englianhu opened this issue Oct 19, 2020 · 7 comments
Open

Statistical Computing with R (2nd Edition).pdf #8

englianhu opened this issue Oct 19, 2020 · 7 comments
Labels
enhancement New feature or request

Comments

@englianhu
Copy link
Owner

[问答]求Statistical Computing with R 客课后答案

Pdf电子书:https://englianhu.files.wordpress.com/2020/10/statistical-computer-with-r-2nd-edition.pdf

@englianhu
Copy link
Owner Author

@englianhu
Copy link
Owner Author

#9 (comment) 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

@englianhu
Copy link
Owner Author

englianhu commented Nov 7, 2020

Explanation on random effects & nested lm via randomeffs2.pdf
lm - random effects & nested model.jpg

@englianhu
Copy link
Owner Author

@englianhu
Copy link
Owner Author

@englianhu
Copy link
Owner Author

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant