Hi Everyone,
I have a dataset looking like this:
Date id var1 var2 var3 var4...
2010 1 ... ... ... ...
2010 1 ... ... ... ...
2010 1 ... ... ... ...
2010 2 ... ... ... ...
2010 2 ... ... ... ...
2010 2 ... ... ... ...
2010 3 ... ... ... ...
2010 3 ... ... ... ...
2010 3 ... ... ... ...
I'd like to find mean of each variable by id. That is, at the end, I want to achieve something like this:
Date id mean_var1 mean_var2 mean_var3 mean_var4...
2010 1 ... ... ... ...
2010 2 ... ... ... ...
2010 3 ... ... ... ...
It would be great if you can help. Thank you in advance.
Best,
Related Posts with Taking Average by id
Panel ardl stata commandDear All, I would like to know how to include the lags of the dependent variable and independent v…
Understanding Margins with a Fractional Proportion DVHi All, I have a proportion DV. I can't use the Code: fracreg command because of my unit of analy…
Moving values from observations into new variables by groupHello everyone, I'm working on a dataset. As you can observe in the example below, I got two variab…
Reporting an error with assumptions revision after VECM trend estimation.Greetings. I want to report an issue I've discover when estimating a VECM model with trend option, l…
Adding more years to datasetHi, I have a dataset containing approximately 640K observations (gravity data). Each data point cont…
Subscribe to:
Post Comments (Atom)
0 Response to Taking Average by id
Post a Comment