Create a new column based on count of two other columns
I am new to STATA but what I want to create a new column that takes the values of two columns for example:
Age Frequency
6 1
7 2
8 5
9 4
And create a third column that shows the values of age based on the frequency. They should look as follows:
6
7
7
8
8
8
8
8
9
9
9
9
So for a frequency of 2, the third column would place two 7's in the column. I have a large dataset of over 10000 values in my column following this format. What is the easiest way I should approach this in excel
Re: Create a new column based on count of two other columns
I don't quite understand - do you want to do this in Stata or Excel?
In Stata the number of observations (rows) is the same for each variable (column) - the dataset must be rectangular. Maybe you just want to generate a variable with the numbers to copy and paste into Excel for some reason. If that's the case then you just need to run:
expand Frequency