ç»å¸¸ä¼éå°çæ
å½¢æ¯ï¼æ们æå
¶ä»æ ¼å¼çæ°æ®,éè¦å¯¼å
¥å° STATA ä¸è¿è¡åæ,建议大家æ¤æ¶å°å
¶ä»æ ¼å¼æ°æ®å¤å¶å°åææ°æ®çæ件ç®å½ä¸,ç¶åç´æ¥ç¨STATA ç导å
¥æ°æ®æ件å½ä»¤å¯¼å
¥åå§æ°æ®,ç¨ç¨åºæ¨¡å¼è¿è¡å¤ç,ç¶å导åºå¤çç»æ.è¿æ ·åçæ大好å¤æ¯ï¼æ¢ä¸ä¼ç ´åæåå§çæ°æ®æ件,å使æ们çæ¯ä¸æ¥æ°æ®å¤çååæè¿ç¨é½æ迹å¯å¾ª.
1 insheet å½ä»¤
示ä¾ï¼3origin.xlsâæ°æ®,å°å
¶æå¼å¹¶å¦å为â3origin.csvâ ,(å¦åæ¶è¯·æ³¨æè¦éæ©âä¿åç±»åâä¸æå,éæ© CSVï¼éå·åéï¼è¿ä¸é¡¹).ç¶åå¨ STATAå½ä»¤çªå£ä¸ç¨ä¸è¿°å½ä»¤å¯¼å
¥
insheet using 3origin.csv,clear
ä¹å¯ä»¥å
å°â3origin.xlsâæ°æ®æå¼å¹¶å¦å为â3origin.txtâ ,ç¶åç¨ä¸é¢çå½ä»¤å¯¼å
¥
insheet using 3origin.txt,clear
å½æ°æ®ä¸æ个åéçä½æ°ç¹å«é¿æè
对导å
¥æ°æ®ç精度è¦æ±å¾é«çæ¶å,éè¦å¨è¯¥å½ä»¤åé¢å double é项.
insheet using 3origin.txt,double clear
2 infileå½ä»¤
对äºâ3origin.txtâæâ3origin.csvâ,è¿å¯ç¨ infileå½ä»¤å¯¼å
¥ STATA,æ¤æ¶éè¦å
æåºåéå.å°¤å
¶è¦æ³¨æ,å½åé为å符åæ¶,è¦å
ææ.
infile id str10 name gender minority economy math using origin.txt,clear
æè
infile id str10 name gender minority economy math using origin.csv,clear
3 infixå½ä»¤
è¿æä¸ç§æ ååçæ°æ®,æ¯ä¸ªåéçä½æ°æ¯ç¡®å®ç,ä¸è¶³æ¶,åé¢ç¨0è¡¥é½,以 originæ°æ®çåé¢å个åé为ä¾,å
¶æ°æ®æ ¼å¼ä¸º
114068
128052
029076
024390
037096
115385
028536
129565
å¦æéå°è¿ç§æ°æ®æ ¼å¼,éè¦å¯¹ç
§æ°æ®è¯´æ导å
¥æ°æ®,ç¸åºçå½ä»¤ä¸ºï¼
infix gender 1 minority 2 economy 3-4 math 5-6 using origin.csv,clear
å
¶ä¸çæ°å为对åºçæ°åä½æ°.
4 outsheet å½ä»¤
ä¸åè¿°ä¸ä¸ªå½ä»¤ç¸å,ææ¶æ们éè¦å° STATA æ°æ®å¯¼åºä¸ºå
¶ä»æ ¼å¼æ°æ®,æ¯å¦ææ¬æ ¼å¼æåç¼ä¸º acs çæ ¼å¼ï¼æ¤æ¶éè¦ä½¿ç¨outsheet å½ä»¤å®ç°,该å½ä»¤çåºæ¬æ ¼å¼å¦ä¸.
outsheet using myresult.txt
outsheet using myresult.asc
æ¤æ¶å»ºç«çæ件 myresult.txt第ä¸è¡ä¸ºåéå,第2ï½6 è¡ä¸ºåéå¼.åéåé´ç¨Tabé®åé.å¦æä¸å¸æå¨ç¬¬ä¸è¡åå¨åéå,åå¯ä»¥ä½¿ç¨nonames é项.å¦ææ件已ç»åå¨,åéè¦ä½¿ç¨ replace é项,ç¸åºçå½ä»¤åå«ä¸º.
outsheet using myresult.asc,nonames
outsheet using myresult.asc,nonames replace
5 ä½¿ç¨ transfer 软件
温馨提示:答案为网友推荐,仅供参考