I have frequency counts based on three variables y , Col1, Col2
as shown below
Col1 Col2 y n
Good Poor 0 0
Good Poor 1 0
Good Rich 1 13
Good Rich 0 8
Bad Poor 0 8
Bad Poor 1 0
Bad Rich 1 15
Bad Rich 0 5
How do I expand this table such that the dataset has number of rows, as indicated in column n
for combination of responses in Col1, Col2 & y
?
For example the dataset should have 13 rows of Col1=Good, Col2=Rich, y=1
, 8 rows of Col1=Good, Col2=Rich, y=0
so on.