01
📊
| A | B | C | D | E |
|---|---|---|---|---|
| register | name | gender | age | retired |
| AA00000001 | АЮУШЦЭНД | ЭМ | 34 | Үгүй |
| AA00000002 | ГОМБО | ЭР | 66 | Тийм |
| AA00000003 | ГАЛТ | ЭР | 72 | Тийм |
| AA00000004 | ЦОГ-ЭРДЭНЭ | ЭР | 73 | Тийм |
| AA00000005 | ЛИГДЭН | ЭМ | 35 | Үгүй |
/// SETTING UP STATA ENVIRONMENT
* Load main data
import excel "data.xlsx", sheet("data") firstrow clear
* Setting date as timeseries variable
tsset date, m
* Generating trend and monthly variables
gen t = _n
gen m = month(dofm(date))
/// ANALYSIS
* Model 1: Trend using OLS
reg data t
estimates store model
* Creating residual variables
predict resid, res
* Checking if residual is White-Noise
wntestq resid
* Statistics
summarize resid
/// FORECASTING
* Forecasting Trend Model
forecast create trend
forecast estimates model
forecast solve, begin(m(2025m12))
forecast clear