How to generate a table with weighted values and percentages of the variables used?

#1
Hi all,

I've been looking all over the web for a solution to this but to avail! So, I'm turning to this forum for a solution, if it exists!

I want to generate a cross tabulation (between 2 variables) in Stata and have the resulting table to show both the weighted values and the percentages. Right now, the only way I've found to get the percentages is to export the data into Ms Excel and perform the calculation there. But this is becoming quite tedious given the large number of tables I need to generate.

I've tried the "tab" command but it seems it works only with sample data because when I include "pweight" in the command, Stata tells me that "pweight is not allowed". :( The command goes like this: "tab varX varY if age>=16 & VarB==1 [pweight = weight], row col

I need to get the same result as the "tab" command but with weighted data.

Any ideas on how to do this?

regards,
Ali

Note: if I use the "table" command, pweight is allowed but percentages are not included in the table.
 
#2
Re: How to generate a table with weighted values and percentages of the variables use

Good day

I struggling with Heckman two step procedures, if someone can help me with command?
 

bukharin

RoboStataRaptor
#3
Re: How to generate a table with weighted values and percentages of the variables use

@zicitron: Following on from timbp, you can use the survey commands eg:
svyset [pweight=weight]
svy: tab varX varY if age>=16 & VarB==1

@emilie_kinfack: no, start your own thread if you have a question unrelated to the current one