dear all
i have the panel data in unbalanced form. i have to convert it into balanced form by imputing the missing values with mean of the respective company from the time period 2011 to 2021.
the following is my data format
company_name | year | var |
20 Microns Ltd. | 2011 | 0.805904 |
20 Microns Ltd. | 2012 | 0.828198 |
20 Microns Ltd. | 2013 | 0.817836 |
20 Microns Ltd. | 2016 | 0.755992 |
20 Microns Ltd. | 2017 | 0.773837 |
20 Microns Ltd. | 2018 | 0.725707 |
20 Microns Ltd. | 2019 | 0.695296 |
20 Microns Ltd. | 2020 | 0.656195 |
20 Microns Ltd. | 2021 | 0.580448 |
3I Infotech Ltd. | 2011 | 5.643716 |
3I Infotech Ltd. | 2013 | 6.415471 |
3I Infotech Ltd. | 2014 | 8.262973 |
3I Infotech Ltd. | 2015 | 7.151063 |
3I Infotech Ltd. | 2016 | 3.419378 |
3I Infotech Ltd. | 2017 | 4.005865 |
3I Infotech Ltd. | 2019 | 6.123732 |
3I Infotech Ltd. | 2020 | 5.872237 |
3I Infotech Ltd. | 2021 | 5.987689 |
I need the output in the following format
company_name | year | var |
20 Microns Ltd. | 2011 | 0.805904 |
20 Microns Ltd. | 2012 | 0.828198 |
20 Microns Ltd. | 2013 | 0.817836 |
20 Microns Ltd. | 2014 | 0.737712 |
20 Microns Ltd. | 2015 | 0.737712 |
20 Microns Ltd. | 2016 | 0.755992 |
20 Microns Ltd. | 2017 | 0.773837 |
20 Microns Ltd. | 2018 | 0.725707 |
20 Microns Ltd. | 2019 | 0.695296 |
20 Microns Ltd. | 2020 | 0.656195 |
20 Microns Ltd. | 2021 | 0.580448 |
3I Infotech Ltd. | 2011 | 5.643716 |
3I Infotech Ltd. | 2012 | 5.875792 |
3I Infotech Ltd. | 2013 | 6.415471 |
3I Infotech Ltd. | 2014 | 8.262973 |
3I Infotech Ltd. | 2015 | 7.151063 |
3I Infotech Ltd. | 2016 | 3.419378 |
3I Infotech Ltd. | 2017 | 4.005865 |
3I Infotech Ltd. | 2018 | 5.875792 |
3I Infotech Ltd. | 2019 | 6.123732 |
3I Infotech Ltd. | 2020 | 5.872237 |
3I Infotech Ltd. | 2021 | 5.987689 |
please suggest to me a SAS code for mean imputation in panel data
thanking you in advance