I want to create a variable which counts the total number of people on a company board per year. The difficulty is that the number changes every year. I have 20 dummy variables for every year, equaling to 1 if the person is present on board, and 0 if not present. I also have a variable id, with a unique number for every company. I can see the total board members per company when I tab id y2020. How can I create this into a variable, which counts the total number of board members, per company, for each year hence calculating Board Size?
Related Posts with Creating a New Variable from a Dummy Variable
SUCRA in Stata 16Dear all, I have noticed that the SUCRA command for network meta-analysis is not working in Stata 1…
Specifying the linear predictor for random intercept model on panel data.Dear Stata Community, I am running a random intercept model on a longitudinal dataset where I am in…
Choosing a control condition in Interrupted time seriesDear colleagues how can I choose the best control condition in Interrupted time-series among the pos…
gsem for latent class analysis_not concave issueHello dear Stata users, I want to run a latent class analysis with 37 variables and approximately 7…
identifying follow-up dates closest to a certain valueHello. I have a dataset with multiple follow-up dates (fu1, fu2 etc.) and corresponding morbidity s…
Subscribe to:
Post Comments (Atom)
0 Response to Creating a New Variable from a Dummy Variable
Post a Comment