Sie sind auf Seite 1von 6

ก

 4
ก

 ก!ก!"
ก

 4 ก
 !"#  ก$ก$#% &'#()
) #*#  ก+) #"
1. ก
.%

!"# /)0* summarize
2. ก$ก$#%/)0* tab1
3. ก$ก$#%#.# /)0* tab2

1. $ก *! ex4_1.dta 



1.1 +@ 0 .+0# A +.#.B) C.B)
 age, sysbp, diasbp
1.2 $ก$#%  sex
1.3 $ก$#%+#  sex, occ

1.1 
+@ 0 .+0# A +.#.B) C.B)  age, sysbp, diasbp, chol


   
1.  stata command M
MC. # 1. M!  ก$ก+0$C
clear [Enter]
2. *. Click   File/Open 2. M!W)(U  *! ex4_1.dta $ก()
 look in:  !ก C:\data C:\data
 File Name:  !ก(U  ex4_1
*.
ก. BV OK
3.  stata command M
MC. # 3. ก++@ 0 .+0# A
summarize age sysbp diasbp [Enter] +.#.B) C.B)  age, sysbp, diasbp
!*
-Statistics/Summaried, tables & tests M dialog box summarize-Summary statistics
/tables/Multiple one-way tables
26

Valiables: (leave empty for all


variable)
 !ก  sex
 ก OK

. summarize age sysbp diasbp


Variable | Obs Mean Std. Dev. Min Max
-------------+--------------------------------------------------------
age | 700 50.27857 8.17903 24 74
sysbp | 700 149.6486 21.1103 72 207
diasbp | 700 81.48 9.72635 53 113

a ก
 () /)0* summarize @M+@ 0 (mean) .+0#-
 A (Std. Dev.) + C.B) (min) +.#.B) (max)  + "! #ก+.%

!"# 
!f B ,detail  #C. # summarize
กE FG"H ! !ก Statistics/Summaried, tables & tests/Summary
statistics/summary statistics/  M dialog box summarize   !ก .g$ 
 !ก  display additional statistics

. summarize age , detail

age
-------------------------------------------------------------
Percentiles Smallest
1% 31 24
5% 37 27
10% 40 28 Obs 700
25% 45 29 Sum of Wgt. 700

50% 50 Mean 50.27857


Largest Std. Dev. 8.17903
75% 56 73
90% 60 74 Variance 66.89654
95% 64.5 74 Skewness .1249485
99% 72 74 Kurtosis 3.248484
27
1.1.2 ก$ก$#%  sex, occ

   
1.  stata commandt M
MC. # 1. ก$ก$#%  sex
tab1 sex [Enter]
!*
-Statistics/Summaried, tables & tests -M dialog box tab1 i One-way tables
/tables/Multiple one-way tables
Categorical variable:  !ก 
sex
 ก OK

-> tabulation of sex

sex | Freq. Percent Cum.


------------+-----------------------------------
0 | 524 74.86 74.86
1 | 176 25.14 100.00
------------+-----------------------------------
Total | 700 100.00

1.1.3 $ก$#%+#  sex, occ



   
1.  stata command M
MC. # 1. ก$ก$#%+#  sex,
tab2 sex occ [Enter] occ
!*
-Statistics/Summaried, tables & tests M dialog box tab2 i Two-way tables
/tables/Multiple one-way tables
28
Categorical variable:  !ก 
sex occ
 ก OK

. tab2 sex occ

-> tabulation of sex by occ

| occ
sex | 1 2 3 4 | Total
-----------+--------------------------------------------+----------
0 | 150 128 133 113 | 524
1 | 49 43 47 37 | 176
-----------+--------------------------------------------+----------
Total | 199 171 180 150 | 700

a ก
 () /)0* tab2 .)#a @M%#  ()B + "
! #ก+!f *+0  !%B col ! row  #C. #
กm* Statistics/Summaried, tables & tests/tables/Multiple one-way tables
! !ก   !ก  Cell content  Within column relative frequencies  
 Within row relative frequencies
29
. tab2 sex occ,row col
-> tabulation of sex by occ

| occ
sex | 1 2 3 4 | Total
-----------+--------------------------------------------+----------
0 | 150 128 133 113 | 524
| 28.63 24.43 25.38 21.56 | 100.00
| 75.38 74.85 73.89 75.33 | 74.86
-----------+--------------------------------------------+----------
1 | 49 43 47 37 | 176
| 27.84 24.43 26.70 21.02 | 100.00
| 24.62 25.15 26.11 24.67 | 25.14
-----------+--------------------------------------------+----------
Total | 199 171 180 150 | 700
| 28.43 24.43 25.71 21.43 | 100.00
| 100.00 100.00 100.00 100.00 | 100.00

2. $ก *! ex4_2.dta 



2.1 +@ 0  r0A .+0# A  +.#.B) C.B)
 chol
2.2 $ก$#% )0 coro (/ coronary 0= (+ 1= )
2.3 $ก$#%+#  sex, coro  .)#0   sex
)a ก
ก @ 0

J K
2.1 Cm+@ 0  r0A .+0# A  +.#.B) C.B) 
chol

Variable | Obs Mean Std. Dev. Min Max


-------------+--------------------------------------------------------
chol | 700 313.5957 60.0491 85 511

. summarize chol, detail

chol
-------------------------------------------------------------
Percentiles Smallest
1% 181.5 85
5% 216 168
10% 235.5 173 Obs 700
25% 274 175 Sum of Wgt. 700

50% 314 Mean 313.5957


Largest Std. Dev. 60.0491
75% 353 465
90% 390 492 Variance 3605.895
95% 412 497 Skewness .0331218
99% 450 511 Kurtosis 3.027107
30
LM ก  chol  +@ 0 = 313.5957
 r0A = 314
.+0# A = 60.0491
 = 3605.895
+ C .#.B) = 85, 511

2.2 $ก$#% )0 coro (/ coronary 0= (+/ 1= /)

. tab1 coro

-> tabulation of coro

coro | Freq. Percent Cum.


------------+-----------------------------------
0 | 618 88.29 88.29
1 | 82 11.71 100.00
------------+-----------------------------------
Total | 700 100.00
LM ก
M+$ก$C 0+# 700 0aV0)0/ coronary 0 11.71  (+V0)0/
coronary 0  88.29

2.3 $ก$#%+#  sex, coro  .)#0   sex

. tab2 sex coro ,row

-> tabulation of sex by coro

| coro
sex | 0 1 | Total
-----------+----------------------+----------
0 | 463 61 | 524
| 88.36 11.64 | 100.00
-----------+----------------------+----------
1 | 155 21 | 176
| 88.07 11.93 | 100.00
-----------+----------------------+----------
Total | 618 82 | 700
| 88.29 11.71 | 100.00

Das könnte Ihnen auch gefallen