Data file with raters, items and item structures over multiple lines

Top Up Down  A A

Here is the record layout for a multiple-line file:

 

Line 1:  Columns

Hospital  1-4

Treatment 5

Patient ID 6-11

Patient name 12-31

Birth year 36-37

Rater 1 ID 47-48

Rater 1, 16 Activity items 49-64

 

Line 2:

Rater 1, 16 Memory items 1-16

Rater 2 ID 27-28

Rater 2, 16 Activity items 29-44

Rater 2, 16 Memory items 55-70

   

Line 3:  Ignored

 

Item structures:

Subdomain Items

1   1-2

2   3-7

3   8-10

4   11-14

5   15-16

 

The data file is HOSPDAT.txt:

 

UCMC5143477HONDA     KAZUO     02  86 3252333 BF3333333333333333333333333

3231331103100022031223122 SS3333333333333333333333333 3130331223100112131023112

1126150330059802180624040106180358

UCMC5152988HONDA     SHINICHI  09  83 3252333 BF3333333333333333333333333

2311333222100010010Z23123 SS3333333333333333333333333 2001333333000030220333133

1106380468062303900631043006590559

 

Here is the FACFORM file to HOSPkey.txt:

 

; File: HOSPkey.txt

; This converts a "flat" data file into a Facets file (Comments start with ;)

; We want to group items by type

 

; Note: this code can be considerably shortened by nesting $DO loops

 

$input=hospDAT.txt      ;your raw data file

$output=hospFDT.txt     ;FACETS formatted data

$spoutput=hospcon.txt   ;FACETS control

 

; you cannot model all facets simultaneously

; use some for selection and/or anchoring

$facets=8

$flabel=1,hospital

 $flabel=2,treatment

$flabel=3,patient

$flabel=4,birth

$flabel=5,rater

$flabel=6,type

$flabel=7,item ;there are 32 of these: 16 activity and 16 memory

$flabel=8,subdomain

 

; data are processed in chunks of 3 lines

$label=1,,$S1E4  ;hospital code

$label=2,$S5W1   ;treatment

$label=3,$S6E11  ;patient id

$label=4,$S36E37 ;birth year

 

; Rater 1

$label=5,,$S47E48 ;rater code

type=1  ;activity

$label=6,type,"activity"

item=1

column=49  ;starting column

 

;activity 1&2

$label=8,1  ; subdomain 1

$do=2

 $label=7,item,,","+$Q(type) ;flag item as in activity type (no anchor value)

 $rating=$S(column)W1

 item=item+1

 column=column+1

$again

 

;activity 3-7

$label=8,2  ;subdomain 2

$do=5

 $label=7,item,,","+$Q(type) ;flag item as in activity type

 $rating=$S(column)W1

 item=item+1

 column=column+1

$again

 

;activity 8-10

$label=8,3  ;subdomain 3

$do=3

 $label=7,item,,","+$Q(type) ;flag item as in activity type

 $rating=$S(column)W1

 item=item+1

 column=column+1

$again

 

;activity 11-14

$label=8,4  ;subdomain 4

$do=4

 $label=7,item,,","+$Q(type) ;flag item as in activity type

 $rating=$S(column)W1

 item=item+1

 column=column+1

$again

 

;activity 15-16

$label=8,5  ;subdomain 5

$do=2

 $label=7,item,,","+$Q(type) ;flag item as in activity type

 $rating=$S(column)W1

 item=item+1

 column=column+1

$again

 

; now to next line

$nextline

 

; Rater 1

type=2  ;memory

$label=6,type,"memory"

item=17   ;not needed but to remind us 16 independent + 16 professional

column=1  ;starting column

;memory 1&2

$label=8,1  ; subdomain 1

$do=2

 $label=7,item,,","+$Q(type) ;flag item as in memory type

 $rating=$S(column)W1

 item=item+1

 column=column+1

$again

 

;memory 3-7

$label=8,2  ;subdomain 2

$do=5

 $label=7,item,,","+$Q(type) ;flag item as in memory type

 $rating=$S(column)W1

 item=item+1

 column=column+1

$again

 

;memory 8-10

$label=8,3  ;subdomain 3

$do=3

 $label=7,item,,","+$Q(type) ;flag item as in memory type

 $rating=$S(column)W1

 item=item+1

 column=column+1

$again

 

;memory 11-14

$label=8,4  ;subdomain 4

$do=4

 $label=7,item,,","+$Q(type) ;flag item as in memory type

 $rating=$S(column)W1

 item=item+1

 column=column+1

$again

 

;memory 15-16

$label=8,5  ;subdomain 5

$do=2

 $label=7,item,,","+$Q(type) ;flag item as in memory type

 $rating=$S(column)W1

 item=item+1

 column=column+1

$again

 

; Rater 2

$label=5,,$S27E28 ;rater code

 

type=1  ;activity

$label=6,type,"activity"

item=1

column=29  ;starting column

;activity 1&2

$label=8,1  ; subdomain 1

$do=2

 $label=7,item,,","+$Q(type) ;flag item as in activity type

 $rating=$S(column)W1

 item=item+1

 column=column+1

$again

 

;activity 3-7

$label=8,2  ;subdomain 2

$do=5

 $label=7,item,,","+$Q(type) ;flag item as in activity type

 $rating=$S(column)W1

 item=item+1

 column=column+1

$again

 

;activity 8-10

$label=8,3  ;subdomain 3

$do=3

 $label=7,item,,","+$Q(type) ;flag item as in activity type

 $rating=$S(column)W1

 item=item+1

 column=column+1

$again

 

;activity 11-14

$label=8,4  ;subdomain 4

$do=4

 $label=7,item,,","+$Q(type) ;flag item as in activity type

 $rating=$S(column)W1

 item=item+1

 column=column+1

$again

 

;activity 15-16

$label=8,5  ;subdomain 5

$do=2

 $label=7,item,,","+$Q(type) ;flag item as in activity type

 $rating=$S(column)W1

 item=item+1

 column=column+1

$again

 

; for Rater 2

type=2  ;memory

$label=6,type,"memory"

item=17

column=55  ;starting column

;memory 1&2

$label=8,1  ; subdomain 1

$do=2

 $label=7,item,,","+$Q(type) ;flag item as in memory type

 $rating=$S(column)W1

 item=item+1

 column=column+1

$again

 

;memory 3-7

$label=8,2  ;subdomain 2

$do=5

 $label=7,item,,","+$Q(type) ;flag item as in memory type

 $rating=$S(column)W1

 item=item+1

 column=column+1

$again

 

;memory 8-10

$label=8,3  ;subdomain 3

$do=3

 $label=7,item,,","+$Q(type) ;flag item as in memory type

 $rating=$S(column)W1

 item=item+1

 column=column+1

$again

 

;memory 11-14

$label=8,4  ;subdomain 4

$do=4

 $label=7,item,,","+$Q(type) ;flag item as in memory type

 $rating=$S(column)W1

 item=item+1

 column=column+1

$again

 

;memory 15-16

$label=8,5  ;subdomain 5

$do=2

 $label=7,item,,","+$Q(type) ;flag item as in memory type

 $rating=$S(column)W1

 item=item+1

 column=column+1

$again

 

;now skip line 3

$nextline

 

;ok - FACFORM control finished.

;be sure to edit the models= statement etc in the FACETS control file

 

The Facets control file, HOSPCON.txt:

 

; FACFORM Version No. 1.38

; Run on 06-10-1997 11:12:11

; from Keyword file: HOSPCON.txt

Facets = 8

Data file = hospFDT.txt

Models =

?,?,?,?,?,?,?,?,R

*

; Positive = 1

; Noncenter = 1

Labels =

1,hospital

1=RUSH

2=UCMC

*

2,treatment

4=

5=

*

3,patient

137161=

143432=

143477=

151430=

152325=

152988=

153333=

207856=

217997=

*

4,birth

 82=

83=

84=

85=

86=

*

5,rater

1=BF

2=SS

*

6,type

1=activity

2=memory

*

7,item

1=,,1

2=,,1

 |

16=,,1

17=,,2

 |

32=,,2

*

8,subdomain

1=

|

5=

*

and the formatted data is HOSPFDT.txt:

 

2,5,143477,86,1,1,1-2,1,3,3

2,5,143477,86,1,1,3-7,2,3,3,3,3,3

2,5,143477,86,1,1,8-10,3,3,3,3

2,5,143477,86,1,1,11-14,4,3,3,3,3

2,5,143477,86,1,1,15-16,5,3,3

2,5,143477,86,1,2,17-18,1,3,2

2,5,143477,86,1,2,19-23,2,3,1,3,3,1

2,5,143477,86,1,2,24-26,3,1,0,3

2,5,143477,86,1,2,27-30,4,1,0,0,0

2,5,143477,86,1,2,31-32,5,2,2

2,5,143477,86,2,1,1-2,1,3,3

2,5,143477,86,2,1,3-7,2,3,3,3,3,3

2,5,143477,86,2,1,8-10,3,3,3,3

2,5,143477,86,2,1,11-14,4,3,3,3,3

2,5,143477,86,2,1,15-16,5,3,3

2,5,143477,86,2,2,17-18,1,3,1

2,5,143477,86,2,2,19-23,2,3,0,3,3,1

2,5,143477,86,2,2,24-26,3,2,2,3

2,5,143477,86,2,2,27-30,4,1,0,0,1

2,5,143477,86,2,2,31-32,5,1,2


Help for Facform Rasch Measurement Software: www.winsteps.com.