Regression Modelling Ass
Regression Modelling Ass
REG.NO. SCM222-0526/2021
FINANCIAL ENGINEERING
REGRESSION MODELLING 1
R-ASSIGNMENT
Library(ggpairs)
Library(corrplot)
Data<-read.csv(“grocery.csv”)
(i) Pairs(data)
(ii)cor_matrix<-cor(data)
print(cor_matrix)
Correlation Matrix:
Correlation matrix
Scatter plots
(b)To fit a multiple regression model
summary(model)
Intercept (4149.89): When X1, X2 and X3 are all zero, the estimated total labor hours (YYY)
is 4149.89.
X1(0.0008): For every additional unit increase in the number of cases shipped (X1=1), total
labor hours increase by approximately 0.0008 hours, holding other variables constant.
X2 (-13.166): For every 1% increase in indirect costs as a percentage of labor hours (X2=1),
total labor hours decrease by 13.166, holding other variables constant. However, X2 is not
X3 (623.55): If the week includes a holiday (X3=1), total labor hours increase by 623.55
compared to non-holiday weeks, holding other variables constant. This coefficient is highly
qqnorm(residuals)
Brown-Forsythe Test
Library(onewaytests)
print(anova_result)
Decision Rule
If the p-value of the overall F-test is less than α (0.05), we reject Ho and conclude that
there is a significant regression relationship
p-value=3.315708e^-12=0.00002037241
Conclusion: There is strong evidence to suggest that at least one of the predictors X1, X2, or
X3 significantly explains the variability in Y (total labor hours).