CODES= valid data codes = 01

Up  Previous  Next

Says what characters to recognize as valid codes in your data file. If XWIDE=1 (the standard), use one column/character per legitimate code. If XWIDE=2, use two columns/characters per valid code. Characters in your data not included in CODES= are given the MISSCORE= value.

 

Example 1:        A test has four response choices. These are "1", "2", "3", and "4". All other codes in the data file are to be treated as "item not administered". Each response uses 1 column in your data file. Data look like: 134212342132.3212343221

                       XWIDE=1                one character wide (the standard)

                       CODES=1234        four valid 1-character response codes

 

Example 2:        There are four response choices. Each response takes up 2 columns in your data file and has leading 0's, so the codes are "01", "02", "03" and "04". Data look like: 0302040103020104040301

                       XWIDE=2                two characters wide

                       CODES=01020304        four valid 2-character response codes

 

Example 3:        There are four response choices entered on the file with leading blanks, so that codes are " 1", " 2", " 3", and " 4". Data look like: 3 2 4 2 1 3 2

       XWIDE=2                two characters wide

       CODES=" 1 2 3 4"        " required: blanks in 2-character responses

 

Note: when XWIDE=2 or more, both CODES= and the data value are left-aligned before matching, so both " 1" and "1 " in CODES= match both " 1" and "1 "in your data file.

 

Example 4:        Your data is a mixture of both leading blanks and leading 0's in the code field, e.g. "01", " 1", " 2", "02" etc. The numerical value of a response is calculated, where possible, so that both "01" and " 1" are analyzed as 1.

Data look like: 02 1 20102 1 2 01

       XWIDE=2                two characters wide

       CODES=" 1 2 3 401020304"        two characters per response

 

Example 5:        Your valid data are 1,2,3,4,5 and your missing data codes are 7,8,9 which you want reported separately on the distractor tables.

       CODES =        12345789

       NEWSCORE =        12345XXX        ; missing values scored with non-numeric values

 

Example 6:        The valid responses to an attitude survey are "a", "b", "c" and "d". These responses are to be recoded "1", "2", "3" and "4". Data look like: adbdabcd

       CODES   =abcd        four valid response codes

       NEWSCORE=1234        new values for codes

       RESCORE=2                rescore all items

 

Typically, "abcd" data implies a multiple choice test. Then KEY1= is used to specify the correct response. But, in this example, "abcd" always mean "1234", so that the RESCORE= and NEWSCORE= options are easier to use.

 

Example 7:        Five items of 1-character width, "abcd", then ten items of 2-character width "AA", "BB", "CC", "DD". These are preceded by person-id of 30 characters. Data look like:

George Washington Carver III  dabcdBBAACCAADDBBCCDDBBAA

       FORMAT=(30A1,5A1,10A2)        Name 30 characters, 5 1-chars, 10 2-chars

       XWIDE =2                        all converted to 2 columns

       CODES ="a b c d AABBCCDD"        "a" becomes "a "

       NEWSCORE="1 2 3 4 1 2 3 4 "        response values

       RESCORE=2                        rescore all items

       NAME1=1                        name starts column 1 of reformatted record

       ITEM1=31                        items start in column 31

       NI=15                        15 items, all XWIDE=2

 

Example 8:        Items are to rescored according to Type A and Type B. Other items to keep original scoring.

       IREFER = AAAAAAAABBBBBBBBCCCCCCC        ; 3 item types

       CODES   = 1234        Original codes in the data file

       IVALUEA = 1223        Recode Type A items

       IVALUEB = 1123        Recode Type B items

       IVALUEC = 1234        Recode Type * item. Can be omitted

 

Example 9:        The valid responses are percentages in the range 00 to 99.

       XWIDE = 2                two columns each percent

       ; for data with leading zeroes,

       CODES = 0001020304050607080910111213141516171819+

               +2021222324252627282930313233343536373839+

               +4041424344454647484950515253545556575859+

               +6061626364656667686970717273747576777879+

               +8081828384858687888990919293949596979899

or, for data with leading blanks,

       CODES =" 0 1 2 3 4 5 6 7 8 910111213141516171819+

               +2021222324252627282930313233343536373839+

               +4041424344454647484950515253545556575859+

               +6061626364656667686970717273747576777879+

               +8081828384858687888990919293949596979899"

 

Example 10:        Codes are in the range 0-254 (the maximum possible).

XWIDE=3        ; 3 characters per response: data with leading blanks

CODES="  0  1  2  3  4  5  6  7  8  9 10 11 12 13 14 15 16 17 18 19 20 21 22 23+

     + 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47+

     + 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71+

     + 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95+

     + 96 97 98 99100101102103104105106107108109110111112113114115116117118119+

     +120121122123124125126127128129130131132133134135136137138139140141142143+

     +144145146147148149150151152153154155156157158159160161162163164165166167+

     +168169170171172173174175176177178179180181182183184185186187188189190191+

     +192193194195196197198199200201202203204205206207208209210211212213214215+

     +216217218219220221222223224225226227228229230231232233234235236237238239+

     +240241242243244245246247248249250251252253254"

 

Example 11:        The data include negative values, -10, -9, through to positive codes 9, 10. Winsteps can only analyze data that are positive integers, so the data would need to be rescored:

XWIDE=3 ; each observation is 3 characters wide in the data file

; the next line is so that I can be sure that each code is 3 characters wide

;         123123123123123123123123123123123123123123123123123123123123123

CODES   ="-10-9 -8 -7 -6 -5 -4 -3 -2 -1 0  1  2  3  4  5  6  7  8  9  10 "

NEWSCORE="0  1  2  3  4  5  6  7  8  9  10 11 12 13 14 15 16 17 18 19 20 "


Help for WINSTEPS® Rasch Measurement Software: www.winsteps.com.