Hi everyone,
I have been trying to either save my tabulated results as a dataset or export the results to xlsx/csv and have run into issues because my command involves tabulating counts weighted by survey weights (pweights) and a large number of values.
I would like to create a dataset from my crosstab of weighted counts by country of birth (n=100) and survey country (n=68). This is the command I use to produce the table I want to be able to export/save.
svy: tab country_birth country_survey if outcome==1, count format(%11.0f)
I have tried to use tabxl, tabout, and putexcel but keep getting errors because of too many values (tabout) or pweights not being allowed (tab2xl).
Any suggestions as to how I can do this simply would be much appreciated. My present workaround is to collapse by country of birth and survey country and then reshape to wide on the country of birth which then requires long, tedious code to rename variables.
Thanks in advance!
Elise
I have been trying to either save my tabulated results as a dataset or export the results to xlsx/csv and have run into issues because my command involves tabulating counts weighted by survey weights (pweights) and a large number of values.
I would like to create a dataset from my crosstab of weighted counts by country of birth (n=100) and survey country (n=68). This is the command I use to produce the table I want to be able to export/save.
svy: tab country_birth country_survey if outcome==1, count format(%11.0f)
I have tried to use tabxl, tabout, and putexcel but keep getting errors because of too many values (tabout) or pweights not being allowed (tab2xl).
Any suggestions as to how I can do this simply would be much appreciated. My present workaround is to collapse by country of birth and survey country and then reshape to wide on the country of birth which then requires long, tedious code to rename variables.
Thanks in advance!
Elise
Comment