Using Stata for Survey Data Analysis


Download 1.39 Mb.
Pdf ko'rish
bet19/61
Sana08.03.2023
Hajmi1.39 Mb.
#1252470
1   ...   15   16   17   18   19   20   21   22   ...   61
Bog'liq
2009 Usingstataforsurveydataanalysis (1)

colrow, and cell request Stata to include percentages in two-way tables 
Example 5 shows the output of three types of tab commands: a one-way frequency table, a two-way 
frequency table, and a two-way frequency table with row and column percentages. Although the 
stratum variable has the values 1 and 2, the table shows the labels associated with each value,
“Urban” and “Rural”, respectively. Section 6 describes how to create and work with labels. 
Example 5. Using “tabulate” on categorical variables 


Minot
 
 
 
 
 
Using Stata for Survey Analysis 
Page 14 
 

bysort prefix 
This is not an independent command but rather a “prefix” goes before another command and asks 
Stata to repeat the command for each value of a variable. There is no equivalent command in SPSS.
The general syntax is: 
bysort varlist: command
where “varlist” is one or more variables (usually just one) and “command” is the Stata command to be 
repeated. Some examples of the bysort prefix are: 
bysort stratum: sum hh_size for each stratum, give statistics on household size 
bysort stratum: tab b21_q1 for each stratum, give the frequency table of sex of head 
Example 6 shows the output of a bysort command. It produces two tables, one for urban households 
(stratum=u) and one for rural households (stratum=r). The results indicate that female-headed 
household account for 14% of the households in the urban portion of the BLSS sample and 36% of 
the rural portion.
Example 6. Using the “bysort” prefix 
 
save  
This command saves the data in memory. It is equivalent to “save outfile” in SPSS. The syntax is: 

Download 1.39 Mb.

Do'stlaringiz bilan baham:
1   ...   15   16   17   18   19   20   21   22   ...   61




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