Regression Modelli NG Assignment
Regression Modelli NG Assignment
summary(model)
β1^: This coefficient represents the change in total labor hours (Y) for each additional case
shipped (X1), holding other factors constant.
β2^: This coefficient represents the change in total labor hours (Y) for each 1% change in the
indirect labor cost percentage (X2), holding other factors constant.
β3^: This coefficient represents the change in total labor hours (Y) when a holiday occurs
(X3=1), compared to weeks without a holiday (X3=0), holding other factors constant.
The plot helps us to see if the residuals are evenly distributed and show no pattern, meaning
that the regression model can be considered appropriate otherwise if there are many outliers
or the residuals show a systematic trend, the model might need adjustment.
d) Residuals Against Y, X1, X2, X3, and Normal Probability Plot
qqline(residuals, col="red")
library(car) bf_test <- leveneTest(Y ~ factor(c(rep(1, 26), rep(2, 26))), data=rbind(group1, group2))
print(bf_test)
anova(model)
# Interpretation: If p-value < 0.05, reject the null hypothesis (indicating a significant regression
relation)
The p-value test indicates whether the regression model significantly explains variation in
labor hours.
confint(model, level = 0.95) # This provides confidence intervals for all coefficients
After computing the joint confidence intervals for β1 and β3, the results are interpreted based
on whether they include zero (which suggests no effect) or not.
h) Coefficient of Multiple Determination (R²)
# Coefficient of determination R2
summary(model)$r.squared
R² Interpretation:
R2 is the proportion of the variance in the dependent variable (Y, total labor hours) that is
explained by the independent variables (X1, X2, and X3).
For example R2=0.65, or 65% of the variation in total labor hours is explained by the model
leaving 35% unexplained. The higher the R2, the better the model explains the variation in the
dependent variable.