Hi,

I am having problems with forecasting panel data. I have a dataset with about 200 firms and i want to forecast the ESG score and market capitalization for each firm based only on its own past lags for 16 years in the future. However while doing this I run into several problems.
1) How should I start by doing this, I tried to recreate the third example from the stata manual (https://www.stata.com/manuals13/tsfo...pdf#tsforecast). However I can not seem to get it to run. I get it to run regressions for all different firms, with the following:
Code:
by ID, sort : regress ESGScore L(1/3).ESGScore
After which i try to copy the example or use the time series forecast wizard in Stata I get the following error:
Code:
"Command cannot be used with panel data."
I tried reading the following help files as suggested by previous posts on Statalist regarding this problem but I cannot wrap my head around it yet:
Code:
help xtreg postestimation
help predict
help forecast
2) The ESG score can not get lower than 0 or higher than 100. I would think that a logit function (results * 100) would help in keeping these boundaries, is that correct and can stata forecast a logistic regression?

This is a sample of my data:
Note: ID is a firm identifier, MC is the market capitalization in usd and ESG is a score for the firm (on a scale of 0-100)
Code:
* Example generated by -dataex-. To install: ssc install dataex
clear
input byte ID int year double(MC ESG)
1 2015  87606000 41.71
1 2016 1.168e+11 48.68
1 2017  93267760 90.82
2 2015  14359978 58.85
2 2016  12378029 60.55
2 2017  15583315 76.61
3 2015   6321329 69.98
3 2016   6445431 41.58
3 2017   7515226 70.58
4 2015   3658706 63.36
4 2016   3365125 61.86
4 2017   5899798 81.94
5 2015   6731480 52.27
5 2016   8242896 33.99
5 2017  12080157 53.11
end
Thanks in advance!