Analytics for Busines and Economcis
Preface
About the Author
1
Introduction to Posit.Cloud
1.1
What is Posit.Cloud
1.2
Getting Ready for Class
1.2.1
Step 1. Create an Account
1.2.2
Step 2. Join the Class Workspace
1.3
Tour of RStudio
1.3.1
RStudio Layout
1.3.2
Writing and Running R Code
1.3.3
Getting Help
1.4
Conclusion
2
RMarkdown (and Quarto)
2.1
Why use RMarkdown?
2.2
Getting Started with RMarkdown
2.3
Basic Formatting with RMarkdown
2.3.1
Headers
2.3.2
Emphasis
2.3.3
Lists
2.3.4
Links
2.3.5
Images
2.3.6
Blockquotes
2.4
Conclusion
3
A First Look at R
3.1
Understanding Data Frames
3.2
Understanding the $ Operator in R
3.3
Summarizing the miles per gallon variable
3.3.1
Plotting miles per gallon vs horsepower
3.4
Fitting a Trend Line
3.5
Complete Chapter Example
4
Getting Started with R
4.1
Commands and Calculations
4.1.1
Typing Commands at the R Console
4.1.2
Doing Simple Calculations with R
4.1.3
Storing a Number As a Variable
4.2
Functions
4.2.1
Using Functions to Do Calculations
4.2.2
Letting RStudio Help You with Your Commands
4.2.3
Basic and Commonly Used Functions in R
4.3
Vectors and Other Variables
4.3.1
Storing Many Numbers as a Vector
4.3.2
Storing Text Data
4.3.3
Storing “True or False” Data
4.3.4
Indexing Vectors
4.4
Packages and Comments
4.4.1
Using Comments
4.4.2
Installing and Loading Packages
4.4.3
Managing the Workspace
4.5
Working with Data Frames, Lists, and Formulas
4.5.1
Loading and Saving Data
4.5.2
Factors
4.5.3
Data Frames
4.5.4
Lists
4.5.5
Formulas
4.6
Programming in R
4.6.1
Writing Scripts
4.6.2
Loops
4.6.3
Conditional Statements
4.6.4
Writing Functions
4.7
Case Study: Predicting Employee Absenteeism
4.8
Summary
5
The Chi-Square Distribution
5.1
Case Study: Chi-Squared Goodness of Fit Test
5.2
Case Study: Chi-Squared Test of Independence
6
Analysis of Variance (ANOVA)
6.1
Case Study Examples
6.1.1
Test in E-Commerce Data (ANOVA)
6.1.2
Test in E-Commerce Data (Checking our assumptions)
6.2
Case Study Assignments
6.2.1
Analyzing Job Satisfaction Using ANOVA
7
Introduction to Linear Regression
7.1
Case Study: Linear Regression Modeling of House Prices in Windsor
7.2
Case Study Assignments
7.2.1
Wine Quality
8
Linear Regression: Model Evaluation
8.1
Case Study: Wine Quality
8.2
Case Study Assignments
8.2.1
City of Windsor Housing Prices
9
Linear Regression: Interpretation and Prediction
9.1
Case Study: Predicting Home Price in Windsor’s Prime Locale
9.1.1
Step 3: Predicting the Price for a Hypothetical House
10
Data Wrangling with dplyr
10.0.1
Introduction
10.0.2
Select
10.0.3
Filter
10.0.4
Mutate
10.0.5
Summarize
10.0.6
Group_by
10.0.7
Pivot_longer
10.0.8
Pivot_wider
10.0.9
Conclusion
10.0.10
References
11
Logestic Regression
11.1
Case Study:
11.1.1
Introduction
12
Poisson regression
12.1
Case Study:
12.1.1
Introduction
13
Introducing Flexdashboard
13.1
What is Flexdashboard?
13.2
Install Flexdashboard
13.3
Creating a Static Dashboard
13.4
How Layout Changed
13.5
How to Use Storyboards
13.6
Basic Dashboard Design
Published with bookdown
Analytics for Business and Economics
Chapter 12
Poisson regression
12.1
Case Study:
12.1.1
Introduction