Sometimes I need to predict some value to make order. It’s no problem in short perspective, but very important in long period of time. In this case I have to predict a value of alloys surcharge bin in december 2023. I have historical value of this indicator.
Based this I made data frame
#DS for steel
month<-c(102022, 112022, 122022, 12023, 22023, 32023, 42023, 52023, 62023,72023,82023,92023,102023)
value<-c(4.67,4.14, 3.99, 4.52, 4.26, 4.11, 3.69, 3.61, 3.53,3.33, 3.12, 3.1,3.13)
df_ds<-data.frame(month,value)
df_ds
ds_lm<-lm(value~month, data=df_ds)
summary(ds_lm)
##
## Call:
## lm(formula = value ~ month, data = df_ds)
##
## Residuals:
## Min 1Q Median 3Q Max
## -0.6160 -0.4455 -0.2040 0.4120 1.0130
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 4.060e+00 3.394e-01 11.961 1.2e-07 ***
## month -3.951e-06 4.365e-06 -0.905 0.385
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.5422 on 11 degrees of freedom
## Multiple R-squared: 0.06931, Adjusted R-squared: -0.0153
## F-statistic: 0.8192 on 1 and 11 DF, p-value: 0.3848
ggplot(df_ds, aes(month,value))+
geom_point()+
geom_smooth()+
theme(axis.text.x=element_blank())
## `geom_smooth()` using method = 'loess' and formula = 'y ~ x'
## `geom_smooth()` using formula = 'y ~ x'