Hey there I have another question. Here as example for the Grunfeld database: I need a code that calculates the mean of the invest variable for every company with the same number and then automatically continues with the next company number (even if it is not 1,2,3 .. but if there are the following numbers missing like 1,5,9, etc.). In fact that I do not have to enter this code again for all 200 observations, but this is done automatically. After calculating the means I want to divide the calculated means of invest values into quintiles, but so that each company (with same number) always stays in the same quintile based on the mean of invest and cannot jump between the quintiles.
Thanks for your help.
Related Posts with Automatic average calculation
duplicat idDear stata users, In my data I have id for parents ( pid) and id for children (cid). The parents are…
Counting the occurrence of a substringHi, I have a dataset similar to below: id name 1 Aaron, Sarah, Paul, Kim, Ted 2 Sarah, Aaron,…
Dyadic dataset help!!Hello everyone I would like to request some expert help about how to turn a classic wide format dat…
Mediation Panel dataDear all, I am currently conducting a fixed effects panel regression in Stata with the following va…
Sampling multilevel dataDear all, I have a survey data set consisting of 29 countries and roughly 50 000 respondents. I want…
Subscribe to:
Post Comments (Atom)
0 Response to Automatic average calculation
Post a Comment