Hello there,
I have a question concerning my data set. I want to find out the total distribution of values which occur in multiple variables.
My sample is structured as the following:
A participant can have up to 4 different roles, which are represented in 4 different variables (RC1 (rolecode1) RC2 RC3 RC4). In addition, the participant can choose his position from 30 different rolecodes (e.g. Secretary, President, Vice President and so on). These values can also change from year to year, depending on changes of employment / promotion.
Therefore the dataset looks something like this:
participantid year RC1 RC2 RC3 RC4
1 2017 S VP P .
1 2018 S P . .
1 2019 S P . .
2 2017 CB EVP P D
2 2018 CB EVP P .
2 2019 CEO D . .
Now my problem is that I can look at the distribution of only 1 varibale by using: tabulate rolecode1
But I don't know how I can find out the total distribution of for example the rolecode "P" in the entire dataset. In my short example for rolecode2 it would be 0.4, for rolecode3 it would be 1 and for the entire example it would be 0.3125.
Does anybody have an idea how I can create an overview like the command 'tabulate' does, but for the distribution of all rolecodes in the 4 distinctive variables?
Like this:
Rolecodes Frequency Percent
S 3 0.1875
CB 2 0.125
CEO 1 0,0625
VP 1 0.0625
P 5 0.3125
EVP 2 0.125
D 2 0.125
Your help is very much appreciated.
Related Posts with Distribution of values among multiple variables
multiple regression - r(2000) error messageHi everyone, I am new here and quite new to Stata (student) so thank you upfront for your help. I …
multiple regression - r(2000) error messageHi everyone, I am new here and quite new to Stata (student) so thank you upfront for your help. I …
'No observations' errorDear all, I'm trying to conduct a unit root test to my variables using the following code: Code: …
Problem with esttab and estpost, exporting to latexHello all, I am trying to export my tabstat table to Latex, however, my code only generates an almo…
Regarding error message “ fpc for all observations within a stratum must be the same” with PPS sampling design, how to handle it ?Dear Statalists, I am running analysis on a survey dataset which use multi-stage stratified systemat…
Subscribe to:
Post Comments (Atom)
0 Response to Distribution of values among multiple variables
Post a Comment