Hi everyone -- apologies if this is not the correct way to post, this is my first time posting and I am new to Stata. I would like to know if I can use xtset with my data. I am using Stata 15.1
I have health expenditure data for 23 countries over a period of 6 years. The data is also split up by the source of expenditure (government, external, private) and the health area in which the expenditure is being spent (ie. HIV/AIDS/STDs, Family Planning, Contraception). I want to look at the expenditure trends for each expenditure type
Variables:
Country: country name
id: 1-23
year: 2014-2019
expsource: Domestic general, domestic private, external
exparea: HIV/AIDS, Maternal Conditions, Contraceptive Management
expcapita: expenditure per capita (on each health area and by each source)
One thing I would like to look at is the the relationship between government, external, and private expenditure over time for each of these health areas to see if I see any substitution effects (ie. are government expenditures increasing/decreasing while external and private increase/decrease). To run estimations I wanted to set my data as panel data. However, because my data repeats time values within the panel (each year appears 3 times per country (id), it does not work to use xtset and I get an error (r(451) repeated time values within panel.
Is it possible to define multiple panels to have each time variable only appear once per id? Or is there a better way to go about this? Any help is greatly appreciated.
I have health expenditure data for 23 countries over a period of 6 years. The data is also split up by the source of expenditure (government, external, private) and the health area in which the expenditure is being spent (ie. HIV/AIDS/STDs, Family Planning, Contraception). I want to look at the expenditure trends for each expenditure type
Variables:
Country: country name
id: 1-23
year: 2014-2019
expsource: Domestic general, domestic private, external
exparea: HIV/AIDS, Maternal Conditions, Contraceptive Management
expcapita: expenditure per capita (on each health area and by each source)
One thing I would like to look at is the the relationship between government, external, and private expenditure over time for each of these health areas to see if I see any substitution effects (ie. are government expenditures increasing/decreasing while external and private increase/decrease). To run estimations I wanted to set my data as panel data. However, because my data repeats time values within the panel (each year appears 3 times per country (id), it does not work to use xtset and I get an error (r(451) repeated time values within panel.
Is it possible to define multiple panels to have each time variable only appear once per id? Or is there a better way to go about this? Any help is greatly appreciated.
Comment