I am trying to make a table of descriptives with two panels.
I am using pweights, and in the second panel a factor variable with three age groups.
When run the two lines with dtable separately, the i.age_grp factor variable correctly shows four rows: 'Age group' and then followed by three rows with the count and percentages of counts.
For some reason, when I try to combine the two tables into one, running the last line shows all the rows present in the separate tables except the four rows relating to the factor variable.
When I run
it correctly shows the 1.age_grp 2.age_grp 3.age_grp included in the levels.
I tried running things like
and
, but I get 'Your layout specification does not identify any items'.
I am using pweights, and in the second panel a factor variable with three age groups.
When run the two lines with dtable separately, the i.age_grp factor variable correctly shows four rows: 'Age group' and then followed by three rows with the count and percentages of counts.
For some reason, when I try to combine the two tables into one, running the last line shows all the rows present in the separate tables except the four rows relating to the factor variable.
Code:
dtable depvar1 depvar2 [pweight=indivwgt], sample(, statistics(frequency)) name(panelA) dtable male age i.age_grp any_educ [pweight=indivwgt], factor(age_grp, statistics(fvfreq fvpercent)) name(panelB) collect combine all = panelA panelB collect layout (collection#var) (result)
Code:
collect levelsof var
I tried running things like
Code:
collect layout (collection[panelB]#var[i.age_grp]) (result)
Code:
collect layout (collection[panelB]#var[1.age_grp 2.age_grp 3.age_grp]) (result)
Comment