Greetings All,
I seem to have a problem in Stata that should be a pretty much straightforward to resolve, but nothing I have tried so far (including egen sum or collapse command), seems to work. I have a firm-level panel data for one country only. I am trying to calculate total employment over 5-year time periods. First, I use an egen sum command to sum up employment annually: egen yr_employment=sum(employment), by(year). However, instead of getting the figures on total annual employment, I get firm observations on employment counted. I have tried all possible solutions, and yet nothing worked yet. 'Employment' has a data storage format 'long'. I have read somewhere on Stata forum discussion that sometimes a 'long' format could cause issues as a variable seems to be wrongly treated as string, though it is a numeric. I have generated a new var with a float format, but this hasn't resolved the problem. And I am not sure if it's a 'long' data storage type that causes a problem in the first place. Any suggestions of how I could resolve this problem would be highly appreciated.
Related Posts with egen (sum) is not summing up absolute figures but counts a number of observations
Moderation: Insignificant interaction term but significant marginal effectsDear Statalisters,
I have a cross-sectional dataset (n = 1,145). The theory that I´m using suggests…
SvarHello, I was wondering if anyone could help me with an SVAR model. What would the restriction matrix…
Test posting code
Code:
. xtabond2 ihsdti L2.ihsdti L(1/1)happy1 L(1/1)age L(1/1)age2 L(1/1)child L(1/1)race L(1/1)m…
Stata cannot estimate Confidence IntervalsDear all,
I ran some ANOVA tests for a project and after running estat esize command Stata is not a…
Difference GMM: Hansen test 0.000 despite N>T, collapse doesn't fixHello all,
I am running difference GMM to eliminate known reverse causality between my dependent va…
Subscribe to:
Post Comments (Atom)
0 Response to egen (sum) is not summing up absolute figures but counts a number of observations
Post a Comment