Comments (2)
Only at end of semester.
from moderndive_book.
library(moderndive)
# Evals data with correct factor levels
evals
#> # A tibble: 463 x 13
#> ID score age bty_avg gender ethnicity language rank pic_outfit
#> <int> <dbl> <int> <dbl> <fct> <fct> <fct> <fct> <fct>
#> 1 1 4.7 36 5 female minority english tenure… not formal
#> 2 2 4.1 36 5 female minority english tenure… not formal
#> 3 3 3.9 36 5 female minority english tenure… not formal
#> 4 4 4.8 36 5 female minority english tenure… not formal
#> 5 5 4.6 59 3 male not minor… english tenured not formal
#> 6 6 4.3 59 3 male not minor… english tenured not formal
#> 7 7 2.8 59 3 male not minor… english tenured not formal
#> 8 8 4.1 51 3.33 male not minor… english tenured not formal
#> 9 9 3.4 51 3.33 male not minor… english tenured not formal
#> 10 10 4.5 40 3.17 female not minor… english tenured not formal
#> # ... with 453 more rows, and 4 more variables: pic_color <fct>,
#> # cls_did_eval <int>, cls_students <int>, cls_level <fct>
# Model of teaching score as a function of age
model_score <- lm(score ~ age, data = evals)
# Tidy regression table with confidence intervals & p-values stars removed:
get_regression_table(model_score)
#> # A tibble: 2 x 7
#> term estimate std_error statistic p_value lower_ci upper_ci
#> <chr> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl>
#> 1 intercept 4.46 0.127 35.2 0 4.21 4.71
#> 2 age -0.006 0.003 -2.31 0.021 -0.011 -0.001
# Outcome + explanatory/predictor variables, fitted/predicted values, and residuals:
get_regression_points(model_score)
#> # A tibble: 463 x 5
#> ID score age score_hat residual
#> <int> <dbl> <dbl> <dbl> <dbl>
#> 1 1 4.7 36 4.25 0.452
#> 2 2 4.1 36 4.25 -0.148
#> 3 3 3.9 36 4.25 -0.348
#> 4 4 4.8 36 4.25 0.552
#> 5 5 4.6 59 4.11 0.488
#> 6 6 4.3 59 4.11 0.188
#> 7 7 2.8 59 4.11 -1.31
#> 8 8 4.1 51 4.16 -0.059
#> 9 9 3.4 51 4.16 -0.759
#> 10 10 4.5 40 4.22 0.276
#> # ... with 453 more rows
# Scalar regression summaries with MSE & RMSE added:
get_regression_summaries(model_score)
#> # A tibble: 1 x 8
#> r_squared adj_r_squared mse rmse sigma statistic p_value df
#> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl>
#> 1 0.011 0.009 0.292 0.540 0.541 5.34 0.021 2
Created on 2018-07-12 by the reprex package (v0.2.0.9000).
from moderndive_book.
Related Issues (20)
- Update all "Scenarios of sampling for inference"
- Add quotation marks to "beauty" score in text
- Ch 11 Inference for Regression: Amplify what todo if any of LINE conditions aren't met
- Update language in Preface
- Getting error in building to epub format HOT 1
- Rendering error-section reference in Ch. 9 HOT 1
- Implement .by argument instead of group_by() HOT 1
- Typo in book
- Change to base R pipe from magrittr pipe
- List of potential typos
- Change to bs4_book for format?
- Add figure with population mean weight of almonds marked with red line
- v2 Ch8 discussion points
- Ensure we can get semi-frequent estimates of delta in PDF page count HOT 2
- Discount code HOT 1
- V2 drop down menus for sections in LHS menu don't work
- Appendix C - Interactive Plot HOT 3
- Ch8 - Two links are broken
- pdf version HOT 1
- Change pipe on moderndive.com HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from moderndive_book.