Epidata v2.1

  • View
    8.837

  • Download
    1

Embed Size (px)

Text of Epidata v2.1

  • 1.MC LCLi cm n .....................................................................................................................1Phn 1 Gii thiu v epidata .......................................................................................21. Gii thiu v chng trnh Epidata ....................................................................22. Cc bc to mt form s liu hon chnh ........................................................32.1. Khai bo b cu hi To tp .qes .........................................................................32.2. To tp d liu - to tp.rec .....................................................................................52.3. Thit rng rng buc s liu to tp .chk.............................................................52.4. Nhp s liu ..............................................................................................................72.5. Xut tp s liu ........................................................................................................83. Ghp s liu .......................................................................................................... 104. So snh s liu nhp 2 ln .................................................................................. 13Phn 2: Cc v d v to form nhp s liu ........................................................... 18V d 1 .......................................................................................................................... 18V d 2:......................................................................................................................... 19

2. Li cm n Chng ti xin chn thnh by t lng bit n chn thnh v su sc n ca CN TrnBnh Thng v CN Hong nh Tuyn, l nhng ngi h tr chng ti trong qutrnh thc hin cun cm nang ny. Mc d rt c gn trong qu trnh bin son nhng khng th trnh c nhngthiu st, chng ti mong nhn c nhng ng gp, ph bnh ca cc bn c honthin cun cm nang ny.Mi thc mc xin lin h qua a ch Email: hoangducthuananh@gmail.com.1 3. Phn 1 Gii thiu v epidata1. Gii thiu v chng trnh EpidataKhi m chng trnh Epidata, ta c mt giao din nh hnh trn. S c bit ca chng trnh nm thanh cng c pha di thanh thc n. y l mt tin trnh bao gm 6 bc, v c mt b s liu hon ho, bn s iqua 6 bc ny. Su bc ca tin trnh lm vic vi Epidata gm: nh ngha d liu (1.DefineData), to tp d liu (2.Make Data File), thit lp cc kim tra li s liu (3.Checks),nhp d liu (4.Enter Data), to cc bo co m t d liu (5. Document), xut tp s liusang cc nh dng khc (6. Export Data). Trong Epidata, chng ta quan tm n 3 loi tp tin, lun phi c, v khi chuynform nhp s liu cho ngi nhp, ta phi chuyn ng thi 3 tp tin ny. Tp .QES (QUESTIONAIRE): c Epidata s dng lu tr cc dng khai bob cu hi. Mt b cu hi c nhiu cu hi v nhiu p n. Chng ta vit li cc cu hiv p n vo trong tp .QES, theo c php cu lnh do Epidata quy nh, lm c s Epidata sinh ra tp .REC theo mong mun ca ngi s dng, c gi l khai bo bcu hi. Tp .REC (RECORD): cha s liu do ngi nhp liu nhp s liu t cc b cuhi vo form nhp liu. Tp .REC c sinh ra trn c s ni dung ca tp .QES. Tp.REC l c s Epidata to ra form nhp s liu khi nhp s liu. Tp .CHK (CHECK): cha cc dng lnh khai bo cc rng buc s liu nhm hnch li trong khi nhp s liu.2 4. TextAuto IDNumericnumberKiubin LogicSoundex DateEpidata hiu c 6 loi bin nh hnh trn, v chng ta s tm hiu cu trc culnh thng qua mt v d phn 2.1.2. Cc bc to mt form s liu hon chnh 2.1. Khai bo b cu hi To tp .qesy l bc u tin v l bc quan trng nht trong tin trnh 6 bc toform nhp s liu to tp QES, trn ca s chng trnh Epidata ang m, chn 1.Define data vchn New .QES file trn thanh cng c.Dng khai bo mt trng s liu trong tp QES l c s Epidata sinh ra tntrng, nhn v kiu d liu ca trng s liu trong tp d liu. 3 5. Chui Tn binNhn binnh dng V d: khai bo nhng thng tin sau:PHIU KIM TRA KAP CA NGI CAO TUI V TNG HUYT PNgy iu tra .thngnm 200..H v tn:TuiGiiTrnh vn ha..Chiu cao: .. Cn nng .. Khai bo nh sau:Id ma so phieu@ nh m s t ngDate ngay dieu tra@ kiu d liu dngdateName Ho va ten@ d liu kiu Text,d liu nhp vo s tng in hoa, rngph thuc vo s lngk t trngAge tui@## d liu Numeric, trng ph thuc vo kt #Sex Gii@d liu dngc/khng, trong v dny, nam tng ng viY, n tng ng vi NHv Trinh do van hoa @__________ d liu kiu text, rng ph thuc vos k t _Cc chieu cao@##.# d li dng s, du. L du php phn.Cn can nang @##.#Sau khi hon tt, ta tin hnh lu tp qes4 6. Lu : khi bn chnh sa file qes sau khi to file rec, bn phi to file rec mi, ghi ln file c nu bn mun, th chnh sa mi c hiu lc. 2.2. To tp d liu - to tp.recNu cha c tp REC th ngi sa dng vn cha c tp cha s liu bt ucng vic nhp liu. sinh ra tp REC t mt tp QES, ta chn 2. Make data file trnthanh cng c v chn Make data file, hp thoi to tp s liu xut hin nh sau: Hp thoi c hai mc l Name of .QES file v Name of data file, ta c th nhn nt chn tp QES v nhp tn tp REC vo mc Name of data file ri chn OK ktthc to tp REC. 2.3. Thit rng rng buc s liu to tp .chkEpidata c chc nng checks hn ch . thc hin iu ny, ta vo 3. Checks.Hp thoi Select data file for checks xut hin yu cu ngi s dng chn tp REC.Ta chn tp REC m ta mun check, ri nhn open. Hp thoi c hnh nh sau: 5 7. La chn trng thit lprng buc s liuCh nhp s liu tho mniu kin.V d: range 1-3 ch nhp sliu trong khong 1-3.Range 1,3: ch c nhp s1 hoc 3 To bc nhy. V d:ti bin a1, nu ta vit: - 2>a5 nhy n bin a5 - 3>write: nhp gi tr 3 th s ghi bn ghiBt buc nhp gi trLu li cc thit lp ng ca s CheckLp li gi tr nhp bn ghi trcKhai bo ch thchM ca s cu lnh ca Epidata.Trong ca s ny, ta c th to ra cc thit lp trn thng qua cc cu lnh.Chng ti s gii thiu mt s cu lnh ph bin thng hay s dng. Cc bnc th thao kho thm ti epidata.dk.Mt s cu lnh ph bin s dng trong Epidata1. BEFORE ENTRY/ AFTER ENTRY: Chy cu lnh trc/sau khi nhp gi tr vo bin.V d: Before entryCommandCommandEnd2. CONFIRMFIELD: ch chuyn n bin tip theo khi nhn Enter3. KEY UNIQUE: to trng kho chnh, gi tr trong bin ny ch xut hin 1 ln, p dngcho cc bin ID4. COMMENT LEGAL USE s dng nhn cho binV d: COMMENT LEGAL USE bao5. HIDE, UNHIDE n/hin 1 bin no V d: hide a1Unhide a46. MUSTENTER / NOENTER bt buc nhp/khng nhp 1 bin. 6 8. 7. TYPE COMMENT p dng trong bin c s dng nhn, khi nhp gi tr vo, s xut hinnhn ca gi tr bn cnh bin.8. CLEAR: xo gi tr trong 1 bin, thng c s dng kt hp trong cu lnh IFV d: Clear a19. HELP: xut hin 1 thng bo khi khng thon mn 1 iu kin no , thng s dng cngvi cu lnh IFV d: help chi bien a1 moi co the nhan gia tri 5, de nghi xem xet lai10. GOTO n 1 bin no khi thon mn 1 hay nhiu iu kin, p dng trong cu lnh IFV d: goto a111. IF THEN ELSE ENDIFV d:if (a1=1) or (a2=1)thenhelp 2 bien a1 va a2 khong the dong thoi nhan gia tri 1goto a1(clear a1) and (clear a2)Endif12. Ngoi cc cu lnh trn, Epidata cn h tr cc biu thc ton hc nh +, -, *, / vcc biu thc quan h , =, , =. 2.4. Nhp s liu nhp s liu, ta nhn vo 4. Enter Data. Chn tp d liu ta mun nhp, sau bt u nhp. (2) (3)(1) (3) (2) (4) (5)(1): bn ghi ang thao thc hin ti, nu New/1: ang nhp bn ghi mi(2): ti bn ghi u tin/cui cng 7 9. (3): ti bn ghi trc/sau(4): to bn ghi mi(5): xo 1 bn ghiKhi nhp n cui form, thng bo sau xut hin: y l thng bo bn ghi (phiu) bn ang nhp s c lu li. Nhn Yes nu bn hon thnh phiu, No nu bn mun sa li bn ghi ang nhp.Lu : khi xo mt bn ghi trong Epidata, bn ghi khng mt i, tuy nhin, trong qutrnh xut d liu, n s b gi li. Epidata t ng lu s liu khi bn nhp xong mt bn ghi. Nu chng trnh b tt xut do mt l do no th s liu nhp khng b mt i, ch mt i phiu angnhp m cha lu li. 2.5. Xut tp s liuS dng chc nng xut tp s liu ca Epidata, chng ta c th xut ra mt tps liu c nh dng khc nh Spss, Stata, Excel Chn tp s liu RECChn Export Data trn thanh cng c v chn kiu nh dng s liu u ra.Nu s liu u ra mong mun c nh dng ca SPSS, ta chn Export Data v chnSPSS. Khi hp thoi Open xut hin cn chn tp d liu REC v chn Open. 8 10. Chn cc tham s ty chn v xut tp s liuKhi tp REC c m, hp thoi Export Data xut hin. Vic tip theo l chncc tham s ty chn v nhn OK thc hin xut tp s liu.Ch : Hp thoi Export Data c cc tham s c ngha nh sau:All records: Xut tt c cc bn ghi ca tp d liu. 9 11. From record # to # : Ch xut cc bn ghi t s # n s #Select fields: cho phpchn cc trng d liu s xut hin tp u ra (trng c tch trong danh sch sxut hin trong tp u ra)Lu : nu cc bn chn kiu xut d liu l Spss, chng trnh s xut ra 2 file, gm 1file .sas v file .not. Sau , bn s dng chng trnh Spss chy file .sas, nhn t hpphm Ctrl + a, sau , trn thanh menu, chn Run/All. S liu ca cc bn nhp Epidatas xut hin 1 dataset mi.3. Ghp s liuTrong ca s ca Epidata, chn Data in/out, chn Append/MergeHp thoi Append/Merge xut hinChn cc tp s liu thnh phn Trn ca s Append/Merge data files, kch nt lnh chn cc tp s liu cnghp th nht v th hai v chn OK, hp thoi Append/Merge xut hin sau , nhhnh di y: 10 12. Chn phng thc ghp tp v kt thc ghp tp Ty theo yu cu ghp tp s liu m ta c th chn phng thc ghp tngng l Append hay Merge. Ghp tp theo phng thc Append: cc tham s cn c thit lp gm: Resulting data file: tn tp kt qu s c to ra Th Append: th Append c chn thit lp tham s ghp tp Append only data from fields in data file B that also exists in data file A chnh cc trng ca tp kt qu ch gm cc trng ca tp A (tp th nht).Append all fields in data file B ch nh tp kt qu c s trng l s trngca c hai tp thnh phn hp li. Cc ty chn c thit lp s quy nh kt qu tp ghp c sinh ra. Chng hn,ta mun ghp hai tp women.rec (tp A) trong th mc khamthai v tp women.rec (tpB) trong th mc khc (th mc khamthaitest1) theo phng thc Append. Yu cughp tp l ch ghp nhng s liu tn ti trong cc trng ca tp A m tn ti trong tpB. Cc tham s ty chn c hnh nh nh sau: 11 13. Sau khi thit lp c cc tham s cho phng thc ghp tp, ta chn ntlnh Append kt thc vic ghp tp.Ch : Sau khi chn Append, Epidata s hi t nhn ch thch cho tp ghp,ta c th chn OK b qua vic t nhn tp.Ghp tp theo phng thc Merge: ghp tp theo phng thc Merge c thc hintng t nh vi ghp tp theo phng thc Append. S khc bit ch l cc tham s tychn c thit lp, cc tham s ty chn nh sau: Nu chn phng thc ghp tp l Append, ta phi chn th Append trnhp thoi th vi ghp tp theo phng thc Merge, chn th Merge trn hp thoi. Select key fields: cho php chn trng kha c s dng lm cn c hpnht hai tp. Trng kha c chn cho ghp tp phi l mt trng ng thi