Using Stata for Survey Data Analysis


Download 1.39 Mb.
Pdf ko'rish
bet37/61
Sana08.03.2023
Hajmi1.39 Mb.
#1252470
1   ...   33   34   35   36   37   38   39   40   ...   61
Bog'liq
2009 Usingstataforsurveydataanalysis (1)

tabulate … summarize 
This command creates one- and two-way tables that summarize continuous variables. The command 
tabulate by itself gives frequencies and percentages in each cell (cross-tabulations). With the 
“summarize” option, we can put means and other statistics of a continuous variable. The syntax is: 
tabulate varname1 varname2 [if exp] [in range], summarize(varname3) options
where 
varname1
is a categorical row variable 
varname2 
is a categorical column variable (optional) 
varname3 
is the continuous variable summarized in each cell 
options
can be used to tell Stata which statistics you want 
Some notes regarding this command: 
The default statistics are the mean, the standard deviation, and the frequency. 
You can specify which statistics with options “means” “standard” and “freq” 
You can use the abbreviation “tab…sum” 
This command is similar to the Stata command “bysort var3: sum var3” except that the 
“tab…sum” output is more attractive and “tab…sum” allows two categorical variables 
This command is also similar to the SPSS command “means var3 by var1”
Some examples:
tab region, sum(pcexpend) 
gives the mean, std deviation, and frequency of per 
capita expenditure for each region 
 
tab stratum, sum(hhsize) mean 
gives the mean household size for urban and rural 
households
tab sexhead stratum, sum(pcexpend) 
gives the mean, std deviation, and frequency of per 
capita expenditure in each cell of a 2x2 table of
male/female headed and urban/rural households 
 
In Example 14, we give the output for three “tab…sum” commands. First, “xtile” is used to create a 
variable “pcetercile” which indicates whether a household is in the top, middle, or bottom third in 
terms of per capita expenditure.
The first table is a one-way table (just one categorical variable) showing the mean, standard 
deviation, and frequency of household size for each expenditure category
In the second table, we show per capita expenditure for each expenditure category. The 
“mean” option ensures that only the mean is shown (the standard deviation and frequency are 
removed).



Download 1.39 Mb.

Do'stlaringiz bilan baham:
1   ...   33   34   35   36   37   38   39   40   ...   61




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©fayllar.org 2024
ma'muriyatiga murojaat qiling