How bash2365/multiple-linear-regression-in-r works
Project Type and Purpose
• This is a data-analysis / modelling pipeline in R focused on predicting Atlanta Falcons receiver touchdowns using three different multiple linear regression (MLR) approaches:
a. Optimistic (simplest) model
b. Train-test-split model
c. Improved / ridge-regularized model
• All three models consume the same source data, produce their own graphs, and ultimately feed into a single R Markdown document that generates the final PDF report.
Key File Structure Elements
• Data source:
• Atlanta_Falcons_data.xlsx
• Modeling scripts:
• MLR_Optimistic_Model.R
• MLR Model_Train_Test_Split.R
• Improved_MLR_Model_3.R
• Graph output folders under R_Graphs:
• Optimistic_Model_Graphs
• Trained_MLR_Model
• Improved_MLR_Model_Graphs
• Final report:
• Predicting Atlanta Falcons NFL Receiver Touchdowns with Regression Modelling.pdf
• R Markdown entry point (implicit in scripts and README)
Components
• Data Layer
• Excel Data Source
• Model Pipelines (three parallel pathways)
1. Optimistic Model (R script + graphs folder)
2. Train-Test-Split Model (R script + graphs folder)
3. Improved MLR Model (R script + graphs folder)
• Aggregation & Reporting
• R Markdown processor → Final PDF
• Folder/Output Nodes
• R_Graphs/Optimistic_Model_Graphs
• R_Graphs/Trained_MLR_Model
• R_Graphs/Improved_MLR_Model_Graphs
Relationships and Data Flows
• All three model scripts read from the Excel data source.
• Each script writes its own graphs into its respective subfolder.
• The Optimistic and Train-Test-Split pipelines then feed (data & metrics) into the Improved MLR pipeline.
• The Improved MLR pipeline produces final graphs and key summary statistics, then invokes the R Markdown document.
• The R Markdown step combines all inputs and outputs the final PDF report.
Architectural Patterns and Design Principles
• Modular pipelines: each model is its own component, making it easy to swap or upgrade.
• Linear data flow with convergence: simpler models feed into the most robust model.
• Separation of concerns:
• Data ingestion (Excel)
• Modelling (three R scripts)
• Visualization (graph folders)
• Reporting (R Markdown → PDF)
Technologies and Frameworks
• R language (scripts)
• R Markdown (report generation)
• Excel (data source)
• ggplot2 or base R for graphs (implied by graph folders)
• Possibly caret or glmnet for ridge regression in the improved model