Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Typo in Exercise 1 of 10.4.4? #1730

Open
djbirke opened this issue Jul 10, 2022 · 0 comments
Open

Typo in Exercise 1 of 10.4.4? #1730

djbirke opened this issue Jul 10, 2022 · 0 comments

Comments

@djbirke
Copy link

djbirke commented Jul 10, 2022

Exercise 1 of 10.4.4 asks

In boot_model(), why don’t I need to force the evaluation of df or model?

However, boot_model() does not look up model (except as a default in lm):

boot_model <- function(df, formula) {
  mod <- lm(formula, data = df)
  fitted <- unname(fitted(mod))
  resid <- unname(resid(mod))
  rm(mod)

  function() {
    fitted + sample(resid)
  }
} 

Is this a typo with the correct formulation as follows?

In boot_model(), why don’t I need to force the evaluation of df or formula?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant