Greetings,
I have a panel dataset of 522,000 firms operating in 70 countries, and the timeline in question ranges from 2000 to 2014, where the FIRMID is my panel variable and Year my time variable.
I want to analyze the relationship between two variables ( say, X (firm-level variable) and Y(country-level variable)). However, before starting with my analysis I want to see the whether in the cross-section Y is correlated to X. I have taken the average of X in each country per year, and also the average of Y per country, per year. However, i am not quite sure how to proceed. As far as I know, I can not use pwcorr, since I have a panel dataset.
What would be the appropriate approach to this problem ?
My dependent variable: log(X)
Independent variable: Y
This is what I have done:
Any help and comments would be greatly appreciated! I could use some enlightenment.
Thank you in advance for your time!
I have a panel dataset of 522,000 firms operating in 70 countries, and the timeline in question ranges from 2000 to 2014, where the FIRMID is my panel variable and Year my time variable.
I want to analyze the relationship between two variables ( say, X (firm-level variable) and Y(country-level variable)). However, before starting with my analysis I want to see the whether in the cross-section Y is correlated to X. I have taken the average of X in each country per year, and also the average of Y per country, per year. However, i am not quite sure how to proceed. As far as I know, I can not use pwcorr, since I have a panel dataset.
What would be the appropriate approach to this problem ?
My dependent variable: log(X)
Independent variable: Y
This is what I have done:
Code:
bys country year: egen average_X= mean(X) gen logAverage_X=ln(average_X)] bys country year: egen average_Y=mean(Y)
Thank you in advance for your time!
Comment