ก 1 - @@ Home - KKU Web Hosting · 2006. 6. 6. · 8. | 8 0 62 1 67 183 179 93 361 0 | 9. | 9 0...
Transcript of ก 1 - @@ Home - KKU Web Hosting · 2006. 6. 6. · 8. | 8 0 62 1 67 183 179 93 361 0 | 9. | 9 0...
�����ก������� 1
����������������ก� STATA������������������ ����������������ก� STATA ���� ! "� # �$ %& ��%�ก��
���ก� STATA�'�( ���)$�%������%%���'��(�* # ���+*%,'ก+*-�ก�&.��'� (Start) ����(��(4���
%��ก����ก���ก� STATA -�ก���� Program
������������ ������������� ������������� ������������� � ��������������������������������1. ��)$�%������%%���'��(�* � ! �%��� load =���>'��('ก�
1. ���� ! �%��� load =���>'��('ก� Windows
2. # ���+* Click ���&.��'� (Start) �����'�( � �ก���)$���ก�(4��H �������'�( � (Start menu)
(+���K$L���'�$ ���'M�ก����H ���� run Stata)
�
2
������������ ������������� ������������� ������������� � ��������������������������������3. # ���+* click �� Program ������'�( � �,=% �!����ก� STATA
3. �����,��ก # ���ก� STATA -=��ก>�������4�� Intercooled STATA 8
4. # ���+* Click ������ STATA 8 4. �����L�ก� Run ���ก� STATA ���� load���ก�-=���'��$�*������ก�$�����
�
�'��$�*(����
��,��*
�'��$�*%L�+����"4��
�'��$�*�+$�",,��M*Stata command
3
������������ ������������� ������������� ������������� � ��������������������������������5. # ���+* Click �������� File/Open 5. �������ก # �X,*� ���, �ก��L��� �� ���,+�4
���ก� STATA �,=��ก>ก��+��!,�����-���� ���กก��+��!,���$��ก,4���4��dialog box& #�� �Use New Data&
6. �� look in: # ���+* Click (�,�ก[ drop down list �,��ก C:\data �� File Name: �,��ก�X,* ex1_1 # ���+*%,'ก+*���&.� Open
6. ��ก>(�������'��$�*(���� (Variables)
#��(����%L��M'���(����
4
������������ ������������� ������������� ������������� � ��������������������������������7. �� stata command �'��* describe [Enter](<=>? �@�A���ก�B STATA @C�DE�BEF�GHก)
7. ����ก��M'���,�ก`a=� ���, �!�4��%���-L��,= �$'++* �$���ก>",,��M*���'��$�*",,��M*(Stata Result) $�����
Contains data from C:\data\ex1_1.dta �
obs: 10 �
vars: 10 � 2 May 2000 18:28 �
size: 170 (99.9% of memory free) �-------------------------------------------------------------------------------
storage display value
variable name type format label variable label
-------------------------------------------------------------------------------
idno byte %8.0g identification number �sex byte %8.0g
age byte %8.0g
occ byte %8.0g �weight byte %8.0g
height int %8.0g
sysbp int %8.0g
diasbp byte %8.0g
chol int %8.0g
coro byte %8.0g
-------------------------------------------------------------------------------
Sorted by:
<=>�J��>� � �$* �X,*�$�* �,=#���X,*� ���,�����ก # � -L����� ���,����!�$ � -L����(���� � ��$�$����b��-�$�กc�� ���, � ���$���� ���, � (�����,=#�'$���(���� �$ �ก4 int=(����#�'$(���,���%4�(����(4 -32,767 Kg�32,740 byte=(����#�'$(���,���%4�(����(4 j127 Kg� 100 � %L��M'���(���� (กa����$ กL�!�$)-�กก� # %L�+�� describe �+$��4��X,*� ���,#�� ex1_1.dta ��-L����� ���,����!�$ 10 �� -L����(���� 10 (���� �$�(�����=ก��$ �� idno sex age occ weight height sysbp diasbpchol coro
5ก>��?K��>�ก>�L��B�G (list)
������������ ������������� ������������� ������������� � ��������������������������������1. �� stata command �'��* list [Enter]
M���@C��B�� -Data/Describe data/Describe variables in memory
-กa��,��ก(��������!�$ ! <G�ก?F OK
-�����+$��ก�� ���,
-�� dialog box describe j Describe contents of data
. list +-------------------------------------------------------------------------+ | idno sex age occ weight height sysbp diasbp chol coro | |-------------------------------------------------------------------------| 1. | 1 0 45 4 70 170 174 83 370 0 | 2. | 2 1 35 1 74 162 179 92 300 0 | 3. | 3 0 49 3 69 173 116 67 265 0 | 4. | 4 0 44 4 68 159 155 98 342 0 | 5. | 5 0 30 1 69 160 139 84 268 0 | |-------------------------------------------------------------------------| 6. | 6 0 31 3 64 171 130 67 303 0 | 7. | 7 1 40 4 69 163 187 98 313 0 | 8. | 8 0 62 1 67 183 179 93 361 0 | 9. | 9 0 32 2 68 161 136 76 313 1 | 10. | 10 1 24 2 69 166 125 71 299 1 | +-------------------------------------------------------------------------+
. list ,clean idno sex age occ weight height sysbp diasbp chol coro 1. 1 0 45 4 70 170 174 83 370 0 2. 2 1 35 1 74 162 179 92 300 0 3. 3 0 49 3 69 173 116 67 265 0 4. 4 0 44 4 68 159 155 98 342 0 5. 5 0 30 1 69 160 139 84 268 0 6. 6 0 31 3 64 171 130 67 303 0 7. 7 1 40 4 69 163 187 98 313 0 8. 8 0 62 1 67 183 179 93 361 0 9. 9 0 32 2 68 161 136 76 313 1 10. 10 1 24 2 69 166 125 71 299 1
6ก>�D��<�>QMF<R>?S����������
������������ ������������� ������������� ������������� � ��������������������������������1. �� stata command �'��* summarize [Enter]
-�'��* summary age [Enter] -�'��* summary age [Enter]
1. ���� # �ก�%L���a�,=�+$�%4�+K'('(4��H ���(���� �#4� %4��q,�� +4������������(r��s,s ���� # �q��=%L�+�� summarize �$���4=�&(����-=�+$�%4�+K'('���� ���,�&ก(���� K �=�&(����-=�+$��q��=(������K�ก=�&
. summarize
� � � � � � Variable | Obs Mean Std. Dev. Min Max
-------------+--------------------------------------------------------
idno | 10 5.5 3.02765 1 10
sex | 10 .3 .4830459 0 1
age | 10 39.2 11.18332 24 62
occ | 10 2.5 1.269296 1 4
weight | 10 68.7 2.496664 64 74
-------------+--------------------------------------------------------
height | 10 166.8 7.509993 159 183
sysbp | 10 152 26.0555 116 187
diasbp | 10 82.9 12.18788 67 98
chol | 10 313.4 35.25526 265 370
coro | 10 .2 .421637 0 1
<=>�J��>�� (���� � -L����� ���,� %4��q,�� � +4������������(r��� %4�(L�+&$ � %4�+��+&$
7ก>�@C� log file �E� �XK�กH�<=>? ��GQYGGEJF
������������ ������������� ������������� ������������� � ��������������������������������
1. # ���+* click ��,��*
�� dialog box: Begin loging Stata output �� look in: # ���+* Click (�,�ก[ drop down list �,��ก (C\:data) �� File Name: �'��*#���X,* test1 # ���+*%,'ก+*���&.� Save(�X,*�����+ก&, .smcl)
**ก�[��� B�\]GF .smcl ���ก>���̂K\]GF�K�B�� dialox box @M��G��กDR>--=�+$���,=����$����X,*-��'� ��X,*�$'�-���������X,*�$'�(S�>\BRB� log file M�����̂K\]GF@MBR XQ\BR��>ก� box ���)
1. ������)$�X,*�=��� log ����-�$�กc�%L�+���,=",,��M*���ก'$-�ก(L�+�� $������ �ก���)$�X,* logfile %���)$ก4��ก� # %L�+�� $H ����( ��ก�-�$�กc�%L�+���,=",,��M*(4��H
. log using "C:\stata_lab\test1.smcl"-----------------------------------------------
log: C:\stata_lab\test1.smcl
log type: smcl
opened on: 2 May 2000, 15:09:09
-�� dialog box Stata Log Options
2. �� stata command �'��* summary [Enter] �B� ����ก>��?K� %L�+���,=",,��M*-�ก
%L�+��(4��H ! %,'ก+*��
2.�����+$��,=-�$�กc�%L�+���,=",,��M*-�ก%L�+�� summarize ���'��$�* log file
-�� dialog box Stata Log Options
8@M��=>��� ��\L�� �G��ก-�,��ก� View snapshot to log file ������)$$��X,* Close log file �����)$ log file Suspend log file
-���ก>�E�BEF log file <G�ก?F�� File/Print viewer
9Log file -=��)$����-�$�กc�����H K ���4�)$�� dialog box Close log file �����)$ log file-%,'ก+* �����)$!� �(4�� Stata viewer
- ! %,'ก+*�� @M��=>��� ��\L�� �G��ก-�,��ก� Close log file �����)$ log fileM���E�BEF<=>? � log close [Enter]
. log close log: C:\stata_lab\test1.smcl log type: smcl closed on: 2 May 2000, 15:27:38
ก>�L�<D>BCRD��MG�� (help)
������������ ������������� ������������� ������������� � ��������������������������������1. �� stata command �'��* help summarize [Enter]
1. ���� # %L�+�� help �ก�#4���!,��"� # ! ���%���!����,=�'M� # �+$�%L��M'����,=(����4��(4��H
-กa�����ก> --more-- �+$��4���� �%���(4� ! ก$��{��'��* Space bar !�� Enter-$������"� # +���K # %L�+�� help <%L�+��> (����( �� ก���%���#4���!,��