Dear all,
I turn to you for advice once again, as I am working for the first time on a dataset that is not in a time series (i.e. year and id are unique identifyers). My dataset looks a bit like the following :
id yearClosed tradeRecievables
113 2015 946440
113 2016 1037787
113 2014 6237883
113 2012 10739971
113 2013 8890283
Id = a corporation and there are thousands per sector, etc. What I am trying to do is generate a new variable that is the average of tradeRecievables[_n] - tradeRecievables[_n-1], per id. The different closing years are not equal accross the companies (some start at 2007 for example), so I need to tell Stata to treat the command by the set of yearClosed per id for all the ids available.
Is there a way to do that?
Thank you so much in advance!
Related Posts with Programming a loop for non-time series dataset
IV regression and 2SLSIs okay to use one instrumental variable for 2SLS multiple regression? …
svy: logit command stuck on "(running logit on estimation sample)"Hi, I'm trying to run a set of svy: logit commands, but for some reason, including certain variables…
how can I program this log-likelyhood function?Could any one kindly help me program this log-likelyhood funtion in Stata? Sorry inadvance, for the …
how to fix scales on stataHi, I am working on a project and I have 4 variables that go from 0-100, and I am trying to combine …
POLS, FE and REHello, I'm estimating a TFP growth convergence regression type model in a panel with 20 NUTS-2 regio…
Subscribe to:
Post Comments (Atom)
0 Response to Programming a loop for non-time series dataset
Post a Comment