Chapter 6
Predictive Analysis
[(a) Overview, (b) Simple Linear Regression,
(c) Multiple Linear Regression]
Engr. Edward B. Panganiban, Ph.D
1|Page
OVERVIEW: PREDICTIVE ANALYTICS
Objectives of the lesson:
a) Explain the key principles of Predictive Analytics;
b) Perform predictive analytics using regression; and
c) Conduct simulation and optimization based on the predictive model
built.
Predictive analytics
is the use of data to predict future trends and events. It uses historical data to
forecast potential scenarios that can help drive strategic decisions. The
predictions could be for the near future, for instance, predicting the
malfunction of a piece of machinery later that day or the more distant future,
such as predicting your company’s cash flows for the upcoming year.
Key Concepts:
1. Simple Linear Regression
2. Multiple Regression
3. Polynomial Regression using Excel
4. Logistic Regression
5. Using Excel Functions for Prediction
Predictive analytics can be used to answer a variety of questions, such as:
1. Which customers are most likely to churn?
2. Which products are most likely to sell well?
3. Which machines are most likely to fail?
4. Which patients are most likely to be readmitted to the hospital?
5. Which fraudulent transactions are most likely to occur?
2|Page
Predictive analytics can be used in a variety of industries, including:
● Retail: Retailers can use predictive analytics to predict sales demand,
optimize inventory levels, and target marketing campaigns.
● Financial services: Banks and other financial institutions can use predictive
analytics to detect fraud, assess risk, and make better investment decisions.
● Healthcare: Healthcare providers can use predictive analytics to identify high-
risk patients, improve patient care, and reduce costs.
● Manufacturing: Manufacturers can use predictive analytics to predict
machine failure, optimize production schedules, and improve product quality.
● Insurance: Insurance companies can use predictive analytics to set prices,
assess risk, and detect fraud.
Predictive analytics typically works in three steps:
1. Data preparation: The first step is to prepare the data for analysis. This
involves cleaning the data, removing any errors or inconsistencies, and
transforming the data into a format that can be used by the predictive
analytics model.
2. Model building: The next step is to build a predictive analytics model. This
involves choosing the appropriate statistical algorithm or machine learning
technique and training the model on the prepared data.
3. Model evaluation and deployment: Once the model is built, it needs to be
evaluated to ensure that it is accurate and generalizable. Once the model is
evaluated and found to be satisfactory, it can be deployed to production to
make predictions on new data.
Examples of Predictive Analytics in Action
3|Page
1. Finance Predicting Cash Flow
a) Businesses can use past financial data to predict future sales, income,
and expenses.
b) This helps companies plan budgets, manage resources, and avoid
running out of money.
2. Entertainment & Hospitality Predicting Staffing Needs
a) Hotels and casinos use predictive models to estimate how many
guests will check in.
b) This way, they hire the right number of staff: not too many (wasteful)
and not too few (bad service).
3. Marketing Targeting Customers Better
a) Companies study how people behave online (clicks, purchases,
downloads).
b) By predicting what customers will likely do next, businesses can send
personalized ads and offers at the right time to increase sales.
4. Manufacturing Preventing Machine Breakdowns
a) Machines are monitored with predictive models that warn when a
breakdown is about to happen.
b) Workers can fix the issue early, saving money and avoiding costly
downtime.
5. Healthcare Predicting Allergic Reactions
a) Wearable devices (like AbbieSense) can detect early signs of a severe
allergy.
b) The system predicts the reaction, alerts caregivers, and even injects
medicine automatically, saving lives.
c)
Benefits of predictive analytics
Predictive analytics offers a number of benefits, including:
● Improved decision-making: Predictive analytics can help businesses
and organizations to make better decisions by providing insights into
future outcomes.
4|Page
● Increased efficiency: Predictive analytics can help businesses and
organizations automate tasks and improve efficiency.
● Reduced costs: Predictive analytics can help businesses and
organizations to reduce costs by identifying and mitigating risks.
● Increased revenue: Predictive analytics can help businesses and
organizations to increase revenue by identifying new opportunities and
targeting customers more effectively.
Challenges of predictive analytics
Predictive analytics also poses some challenges, including:
● Data quality: Predictive analytics models are only as good as the data
they are trained on. It is important to ensure that the data is accurate,
complete, and representative of the population of interest.
● Model complexity: Predictive analytics models can be complex and
difficult to understand. It is important to have a good understanding of
the model before using it to make predictions.
● Model bias: Predictive analytics models can be biased, reflecting the
biases in the data they are trained on. It is important to identify and
mitigate model bias to ensure that the predictions are fair and accurate.
Conclusion
Predictive analytics is a powerful tool that can be used to improve decision-making,
increase efficiency, reduce costs, and increase revenue. However, it is important to
be aware of the challenges associated with predictive analytics, such as data quality,
model complexity, and model bias. By taking steps to mitigate these challenges,
businesses and organizations can reap the benefits of predictive analytics.
5|Page
SIMPLE REGRESSION
Simple (single) linear regression is a statistical method for modeling the
relationship between two variables.
● One variable, denoted x, is regarded as the predictor, explanatory, or
independent variable.
● The other variable, denoted y, is regarded as the response, outcome,
or dependent variable.
It is one of the most basic and widely used regression models. Simple linear
regression assumes that the relationship between the two variables is linear. This
means that the change in the dependent variable is proportional to the change in the
independent variable.
Key Concepts:
1. Regression analysis is a reliable statistical method of estimating how a
response variable depends on one or more predictors.
2. Regression is an extension of correlation analysis, wherein correlation
analysis is the strength of the linear relationship between a pair of variables,
whereas regression expresses the relationship in the form of an equation and
regression is not only about the correlation between variables but it can
predict the outcomes.
6|Page
Examples of Predictive Analytics in
Action
A regression line is used to model the
relationship between the variables.
This is an AI generated picture.
Independent and dependent variables
How do we check regression assumptions? We examine the variability remaining
after fitting the regression line. We simply graph the residuals and look for any
unusual patterns.
If a linear model makes sense, the residuals will
● have a constant variance
● be approximately normally distributed (with a mean of zero), and
● be independent of one another.
7|Page
Examples
1. For example, if curvature is present in the residuals, then it is likely that there
is curvature in the relationship between the response and the predictor that
our model explains. A linear model does not adequately describe the
relationship between the predictor and the response.
In this example, the linear model systematically over-predicts some values
(the residuals are negative), and under-predicts others (the residuals are
positive).
Curvature
2. If the residuals fan out as the predicted values increase, then we have what is
known as heteroscedasticity (not constant). This means that the variability in
the response is changing as the predicted value increases.
This is a problem, in part, because the observations with larger errors will
have more pull or influence on the fitted model.
8|Page
Heteroscedasticity
3. An unusual pattern might also be caused by an outlier. Outliers can have a
big influence on the fit of the regression line.
In this example, we have one obvious outlier. Many of the residuals with lower
predicted values are positive (these are above the center line of zero),
whereas many of the residuals for higher predicted values are negative.
The one extreme outlier is essentially tilting the regression line. As a result,
the model will not predict well for many of the observations.
Outlier
Formula
y= b x + a
x= independent variables
y= dependent variables
b= slope
a= intercept
9|Page
Running a Simple Linear Regression in Excel
1. Select "Data" from the toolbar. The "Data" menu displays.
2. Select "Data Analysis". The Data Analysis - Analysis Tools dialog box
displays.
3. From the menu, select "Regression" and click "OK".
4. In the Regression dialog box, click the "Input Y Range" box and select the
dependent variable data (Visa stock returns).
5. Click the "Input X Range" box and select the independent variable data (S&P
500 returns).
6. Click "OK" to run the results.
Interpreting the Output
● Model Summary
o R = the simple correlation value
o R-Square = measure of effect size for the model - indicates how much
of the variability in the dependent variable can be explained by the
independent variable
● ANOVA
o used to interpret the significance of the overall model
o test statistic = F-ratio
o associate probability (p-value) = "Sig."
● Coefficients
o used to create the regression equation for the predictive model
▪ slope = Unstandardized Coefficient B value for predictor variable
▪ intercept = Unstandardized Coefficient B value for "(Constant)"
o identify which variables are significant predictors in the model
▪ test statistic = t
▪ associated probability = Sig.
10 | P a g e
This will be our example.
Mina sells graham bars beside the school in her Barangay. Mina wants to
predict how many Graham bars she has to make and how many Graham bars
she would sell. She keeps track of how many graham bars she sells versus the
temperature on that day; here are her figures for the last 12 days.
MULTIPLE LINEAR REGRESSION
Multiple Linear Regression
It has the same purpose as the Simple Linear Regression. Both are to
determine the relationship between the dependent variables and the independent
variables; their only difference is the number of independent variables to be
tested. In Simple Linear Regression, the data scientist will only test one
independent variable against one dependent variable. However, in Multiple
Linear Regression, 2 or more independent variables will be used to determine
their relationship to one dependent variable. Hence, it simply means that multiple
linear regression contains more than one independent variable, unlike simple
linear regression.
For instance, we are looking at what influences the student's performance.
According to research, the possible factors are the students' gender, financial
background, and family status.
11 | P a g e
The variable that we want to predict is called the dependent variable
(response variable). In that case, our dependent variable is the students'
performance because that is what we want to predict. Contrarily, the variable we
used for prediction is called the independent variable (predictor/explanatory
variable). The independent variables are students' gender, financial background,
and family status because we used those factors in order to predict the
dependent variable, which is the students' performance.
To sum up everything that has been stated about multiple regression, as
stated by Frost 2017, using multiple linear regression is more focused on looking
at the significance of the independent variables and dependent variables through
identifying and solving the coefficients and P-values. This regression analysis
provides that the coefficients describe the mathematical connection between
each dependent variable and the independent variable. Furthermore, the P-
values for the coefficients indicate whether these relationships are statistically
significant.
Real-life Examples & Simulations:
Have you ever wondered how TV shows come up with a nice segment just to
achieve high ratings? Yet, sometimes they use this method, multiple linear
regression, to predict what will happen to their segment or why their segment
continues to have high ratings despite having a rival show from other networks.
Some TV networks think of their ratings (Dependent Variable) by using the
viewers' response or engagement via social media like Facebook, Instagram,
YouTube, and Twitter (First Independent Variable). Aside from the thoughts online,
they also refer to the live viewers, those who view their episodes live in the studio
(Second independent variable). Furthermore, they may also consider the age of the
viewers, such as which age group is usually entertained by their segments? (Third
Independent Variable). And lastly, aside from the viewers’ response, they may also
look into the duration of their segments. If the segment is more engaging after how
12 | P a g e
many months, or not. Hence, length may also be put into consideration in assessing
the engagement or impact, or the ratings of a certain segment in television.
To give you mores context regarding multiple linear regression, let’s have
here another example.
Health Care: Forecasting Patient Results
Better treatment choices can be made by hospitals and physicians with the use of
MLR. Suppose you would like to forecast a patient's length of stay in the hospital
following surgery based on variables such as:
1. Age
2. Weight
3. The severity of the situation
As an illustration,
Physicians can provide older patients with serious diseases more attention if
the model indicates that age and severity are the best indicators of hospital
stay duration. In order to get these patients home sooner, they may arrange
for more intensive care. Additionally, this helps hospitals effectively manage
their resources, such as ensuring that there are enough beds available.
MLR can also predict solutions in other fields, such as
● Finance, wherein it predicts the relationship between historical prices,
interest rates, and Economic indicators (like inflation or
unemployment), with the help of MRL When managing your
investments, you'll know to keep a closer eye on inflation patterns.
● Business & Marketing, through predicting sales such as modeling the
relationship between tv advertising spend, social media campaign
budget, and discount offers to customers. This prevents businesses
from wasting money on things that don't move the needle.
13 | P a g e
● Environmental science. A scientist might use MLR to predict the
relationship between traffic volume, weather (temperature, humidity),
and industrial activity. It can help them come up with a plan for better
traffic systems.
Key Concepts & Definitions:
● Coefficient - this is the value of the variables if their P-values are zero or not
more than 0.05 - threshold.
● P-values - this will identify if the given variable is accepted or rejected.
● Intercept - it is the coefficient value of the dependent variable if its P-value is
zero or not more than 0.05
● Independent Variables - these are the variables that don’t change from the
given data. They will also test their significance on the dependent variable.
Hence, they are the predicator - either to explain or predict - to every single
value of the dependent variable.
● Dependent Variable - this is the single unit or variable that you want to
measure using multiple independent variables.
Formula and Calculation of Multiple Linear Regression (MLR)
yi =β0+β1xi 1+β2xi2+...+βpxip+ϵ
where, for i=n observations
yi =dependent variable
xi =explanatory variables
β0= y intercept (constant term)
βp=slope coefficients for each explanatory variable
14 | P a g e
ϵ=the model’s error term (also known as the residuals) i1
Steps on how to manipulate the Excel
1. Open your Excel application.
2. Click the Data Tab. And then click the Data Analysis
Note: If there is no Data Analysis that is loaded in your Excel application, just
do the following steps:
● Go over to File, which is located on the Left tab of the Excel.
● Go to “options”
● Hit “Add-Ins”
● Choose Analysis Toolpak, then click “Go”
● Make sure the analysis toolpak is checked
● Click “ok” and the Data analysis is being loaded
3. Proceed to the “Data” ribbon, in the upper part of your Excel application.
4. Click “Data Analysis”
5. Different options will appear on your screen, but you just have to scroll down,
find the “regression”, then proceed with “ok”.
6. Afterward, choose the Y-range from your data. Your dependent variable will
be your Y-range.
7. Furthermore, after inputting your Y-range, proceed to inserting your X-range.
This time, your X-range is your independent variables.
8. Make sure to click the “Labels” button because you have included the labels
of your data when inserting the variables.
9. To finish your data analysis, you just have to click “Output range”, then go to
the space beside the “output range”, and choose any tile from your Excel
sheet to post the result or the data table.
10. And that’s it, click “ok”.
15 | P a g e
11. Now check the P-values of the computed data. If the P-value is more than the
threshold of 0.05, then the independent variable that has a P-value more than
0.05 will not be included.
12. Re-run the data one more time.
13. Follow the same process, but this time, the independent variables that have a
zero to 0.05 P-value will only be included in the regression process.
14. Click “labels”, then go to “output range” once again.
15. Click the empty tile again or below the first table to avoid a collision of the
table of data.
16. After doing so, get the needed information, then plug it into the formula.
yi =β0+β1xi 1+β2xi2+...+βpxip+ϵ
Summary & Conclusion:
Multiple Linear Regression is a powerful tool, and it makes things more
convenient in predicting problems and finding better solutions, whether in predicting
increased sales, saving lives, managing finances, or safeguarding the environment.
MRL plays a vital role in both business and real-life dilemmas. Furthermore, it
enables people to understand the complex relationships among the variables.
Prepare them for more complicated data analysis. It also helps researchers leverage
the factors they want to consider, depending on the outcome or predictions they
come up with.
Above all, multiple linear regression is like a crystal ball that can predict
outcomes and is filled with lots of information. Still, we have to bear in mind that
consideration must be given to its assumptions and potential pitfalls to ensure its
effective application.
References
16 | P a g e
Daines, R. (2025, July 31). LibGuides: Statistics Resources: Simple Linear
Regression. [Link].
[Link]
Frost, J. (2017, April 12). How to Interpret P-values and Coefficients in Regression
Analysis. Statistics by Jim. [Link]
coefficients-p-values-regression/
Hayes, A. (2025, April 14). Multiple Linear Regression (MLR) Definition, Formula,
and Example. Investopedia. [Link]
Husaini, Y. A., & Shukor, A. (2023, January 7). Factors Affecting Students’
Academic Performance: A review. ResearchGate; unknown.
[Link]
ents
JMP Statistical Discovery (2025) Regression model assumptions.
[Link]
simple-linear-regression-assumptions
Pennsylvania State University. (2018). 2.1 - What is Simple Linear Regression? |
STAT 462. [Link]. [Link]
Riswanto, U. (2024, October 21). Multiple Linear Regression Explained with Real-
World Examples. https//[Link]/multiple-linear-
regression-expleined-wth-real-world-examples-bfc29dce29c9
Segal, T. (2024, October 4). Linear Regression Excel: Step-by-Step Instructions.
Investopedia. [Link]
[Link]#toc-interpret-the-results
17 | P a g e