Repository navigation
Update Chapter 8 numbers to match the loans model output - #561
Open
prawalpokharel wants to merge 2 commits into
Open
prawalpokharel wants to merge 2 commits into
prawalpokharel wants to merge 2 commits into
Conversation
Several numbers typed into model-mlr.qmd no longer matched what the chapter's code produces: - tbl-loans-full caption: 9964 residual degrees of freedom, was 9990 - R-squared and adjusted R-squared Guided Practices: use the variances and n (9,974 loans) of the fitted model, replacing values and "auctions" wording left over from the Mario Kart example - forward selection: swap back the credit_checks and issue_month values, and add credit_checks before debt_to_income - backward elimination and forward selection: update the remaining adjusted R-squared values Apart from that order, each step picks the same variable as before and both methods end with the same model.
👷 Deploy request for openintro-ims1 pending review.Visit the deploys page to approve it
|
👷 Deploy request for openintro-ims pending review.Visit the deploys page to approve it
|
The model is fit to 9,974 loans (9,964 residual degrees of freedom plus 10 coefficients), and the factor level is named Source Verified.
This branch has not been deployed
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Several numbers typed into Chapter 8 (
model-mlr.qmd) no longer match what the chapter's code produces. This updates them. Only prose and one table caption change, so the code output is the same.tbl-loans-fullcaption says the model has 9990 degrees of freedom. It has 9964, becauselm()drops 26 loans that are missingdebt_to_incomeorcredit_util.tbl-loans-full-for-model-selection. The variances have three decimals because two decimals give 0.2599.credit_checksandissue_monthwere swapped in the first three steps, andcredit_checksenters the model beforedebt_to_income. The last step gave 0.25854 for the model withoutissue_month, while backward elimination and the table give 0.2598 for the same model. It now says 0.25979.debt_to_incomenorcredit_utilwere already right apart from the swap, so those are unchanged.Apart from that order, each step picks the same variable as before, and both methods still end with the model without
issue_month.Each value comes from
lm()onloansas prepared in the chapter, so models that leave outdebt_to_incomeorcredit_utilare fit to a few more rows than the full model. For example, the first backward elimination step isI rendered the chapter with Quarto 1.4.553 under R 4.5.2 and R 4.6.2. The code output matched the committed
_freeze, so I didn't include a_freezeupdate. I also fixed a stray comma at the end of one of the edited lines.A second commit fixes two things I had first left alone. The SSE formula and the sentence after it now count 9,974 residuals, which is the model's 9,964 residual degrees of freedom plus its 10 coefficients. The equation for the model without
issue_monthnow labels the levelSource Verified, as the data and the full-model equation do. No code chunks change.