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.
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".
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.