Using Stata for Survey Data Analysis


Using Stata for Survey Data Analysis


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

Using Stata for Survey Data Analysis 
 
Minot 
 
Page 33
In the third table, we add a second categorical variable (stratum) making it a two-way table.
Although we could have requested all the default statistics in the two-way table, it makes the 
table difficult to read so we do not advise it. 
Example 14: Using “tab…sum” to create tables
tabstat
This command gives summary statistics for a set of continuous variable for each value of a categorical 
variable. The syntax is: 
tabstat varlist [if exp] [in range] , stat(statname [...]) by(varname)
where 
varlist
is a list of continuous variables 
statname 
is a type of statistic
varname 
is a categorical variable 
Some facts about this command: 


Minot
 
 
 
 
 
Using Stata for Survey Analysis 
Page 34 
 

The default statistic is the mean. 


Optional statistics subcommands include mean, sum, max, min, range, sd (standard 
deviation), var (variance), skewness, kurtosis, median, and pn (nth percentile).
Without the by() option, tabstat is like “summarize” except that it allows you to specify the 
list of statistics to be displayed. 
With the by() option, tabstat is like "tabulate … summarize” except that tabstat is more 
flexible in the statistics and format
It is very similar to the SPSS command “means”. 
Below are several examples of tabstat commands with a description of the table that each will 
produce:
tabstat farmsize hhsize, stats(mean max min) 
gives mean, max, and min of farmsize & 
 hhsize 
tabstat farmsize hhsize, by(reg4)
gives mean of two variables for each region
tabstat farmsize, stats(median) by(reg4)
gives the median farmsize for each region 
And Example 13 shows the output of a tabstat command. The table indicates that per capita 
expenditure is highest in the West and lowest in the East.

Download 1.39 Mb.

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




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