library(fpp3)
## ── Attaching packages ────────────────────────────────────────────── fpp3 0.5 ──
## ✔ tibble      3.2.1     ✔ tsibble     1.1.4
## ✔ dplyr       1.1.4     ✔ tsibbledata 0.4.1
## ✔ tidyr       1.3.1     ✔ feasts      0.3.1
## ✔ lubridate   1.9.3     ✔ fable       0.3.3
## ✔ ggplot2     3.4.4     ✔ fabletools  0.4.0
## ── Conflicts ───────────────────────────────────────────────── fpp3_conflicts ──
## ✖ lubridate::date()    masks base::date()
## ✖ dplyr::filter()      masks stats::filter()
## ✖ tsibble::intersect() masks base::intersect()
## ✖ tsibble::interval()  masks lubridate::interval()
## ✖ dplyr::lag()         masks stats::lag()
## ✖ tsibble::setdiff()   masks base::setdiff()
## ✖ tsibble::union()     masks base::union()
data("us_employment")
view(us_employment)
us_employment|>ggplot(aes(x = Employed,y = Series_ID))+labs(y="Month(quarterly%change)",x = "Employed(quarterly%change)")+geom_point()+geom_smooth(method="|m",se=FALSE)+theme_bw()
## `geom_smooth()` using formula = 'y ~ x'
## Warning: Removed 71073 rows containing non-finite values (`stat_smooth()`).
## Warning: Computation failed in `stat_smooth()`
## Caused by error in `get()`:
## ! object '|m' of mode 'function' was not found
## Warning: Removed 71073 rows containing missing values (`geom_point()`).

{r#fitting the model} model<-lm(Month~Employed+Series_ID,data=us_employment) summary.lm(model)

{# SSR }

```{r#} Y_hat<-model\(fitted.values Y_bar<-mean(us_employment\)Month) SSR<-sum((Y_hat-Y_bar)^2) SSR


```r
#SST
SST<-sum((us_employment$Month_Y_bar)^2)
## Warning: Unknown or uninitialised column: `Month_Y_bar`.
SST
## [1] 0
#Assumptions of MLR

```{r#linearity}


```{r#}
MLR<-lm(Month~Employed+Series_ID,data = us_employment)
summary(MLR)

{r#} plot(us_employment$Month,us_employment$Employed) plot(MLR$residuals,MLR$fitted.values)

There being no pattern exhibited in residual against fitted.values  hence linerity


{r#} MLR<-lm(Month~Employed,data = us_employment) summary.lm(MLR) ```{r#Homoscedacity}



```{r#}
library(performance)
check_heteroscedasticity(MLR)

{r#} library(performance) check_heteroscedasticity(MLR) Hence reject null hypothesis

```{r#Normality of residuals}


```{r#}
check_normality(MLR)

Hence accept nullhypothesis

{r#} Shapiro.test(MLR$residuals) ```{r#multicollinearity}


```{r#}
check_collinearity(MLR)

```{r# Autocorrelation}



```{r#}
check_autocorrelation(MLR)

Hence reject null hypothesis

{r#} DurbinWatsonTest(MLR$residuals)