Hi all,
I have a panel data set in long-form, where the dependent variable (Y) contains data of 10 emerging countries and for each country 30 years. The independent variable (X) contains data of the U.S. over 30 years.
I have used the 'xtset country year, yearly' command and now I would like to use the xtreg-command to do an regression of X on Y, however Stata tells me there are 'insufficient observations'. This is because the Y-var contains 300 observations and the X-var 30.
To solve this I copied the data of the U.S. to all observations. So now I have the following:
Year | Country_i | US | Y_value | X_value
1 India US 0.5 5.5
...
30 India US 0.7 6.0
1 China US 1.3 5.5
...
30 China US 1.4 6.0
1 Brazil US 1.1 5.5
...
30 Brazil US 1.6 6.0
etc.
However, when I now use the correlation command I get an unrealistic low correlation. When I test the correlation between X and Y for each country separately, the correlations are much a higher.
My question is whether my solution is valid and if not whether there is a solutions to let Stata know that one variable contains a panel and the other variable not?
Many thanks in advance.
Chris
Related Posts with How to let Stata know that one variable contains a panel of countries and the other variable contains just one country?
collect: Manipulate rows and columns?I am trying to learn Stata's -collect- and to manipulate tables. I find the manipulating part hard. …
How to do many similar loopsHi, Stata experts, I have need to repeat the same foreach loop for different variables but with the…
New Variable for Average Value of First Half of ObservationsGood morning, I would like to generate a newvar that returns the average of the 'rating' variable, …
KMATCH Matching Diagnostics Tests AvailabilityI started to work with the KMATCH command for propensity score matching and I am a bit struggling wi…
insufficient observations r(2001);hello every one. I am using on cross-section data . but when I run regression I receive this error: …
Subscribe to:
Post Comments (Atom)
0 Response to How to let Stata know that one variable contains a panel of countries and the other variable contains just one country?
Post a Comment