|
Flow control keywords |
Top Up Down
A A |
Start a list of repeated instructions to be repeated (number) times. When (number) is 0 or negative, then the list of repeated keywords is skipped over and not performed. If (number) is not enclosed in parentheses, it is evaluated once, and then counted down by one on each iteration of the repeated instructions until the count reaches zero.
E.g., each person is tested twice on the same task. The observations are in adjacent columns indicated by the value, POINTER. Write out the two ratings.
POINTER = 23 ; responses start in column 23
$Do = 2
$RATING = $I(POINTER) ; value pointed to by POINTER
POINTER = POINTER + 1 ; increment to next column
$Again
$Do = (expression) (start a conditional loop)
If the expression is in parentheses of the form (..), then it is re-evaluated at the start of each run through of the repeated instructions. If true, the keyword list will be performed. E.g., each examinee starts at item 1 and does as many items as possible. A blank follows the last item completed.
EODATA = " " ; a blank flags the end of the data for an examinee
ITEM = 1 ; start with item number 1
DATA = $S(ITEM + 35)W1 ; response to item 1 is in column 36 = 1 + 35
$Do = (DATA<>EODATA) ; if not blank, do the list of keywords
$LABEL=2,ITEM ; the element in facet 2 is the item number
$RATING = DATA ; write the DATA into the Facets-format file
ITEM = ITEM + 1 ; advance to the next item
DATA = $S(ITEM+35)W1 ; obtain the next response
$AGAIN ; do this again
ends a list of repeated keywords. $DO and $Again must be in matched pairs. They may be as many levels deep as necessary.
E.g., each examinee is rated by 5 judges on 10 items
$DO = 5
; judge-related keywords
$DO = 10
; item-related keywords
$Again
$Again
$Nextline (go on to next input data line)
go on to the next line in the input raw data file. This is useful when one element"s observations span more than one data line.
E.g., for each examinee, the responses to items 1-50 are on one line, and 51-100 are on a second line.
ITEM=1 ; start at item 1
$DO = 50 ; do 50 items
; item-related keywords
ITEM = ITEM + 1 ; keep item number current
$Again
$Nextline ; go on to next line of input data
$DO = 50 ; do items 51-100
; item-related keywords
ITEM = ITEM + 1 ; keep item number current
$Again
$If=(expression) (perform conditionally)
start of conditional execution. When the expression is true, the keywords immediately after $If are performed.
$Endif (end of conditional section)
this marks the end of the list of keywords associated with the preceding $If
Example: Only select sub-test "A"
$IF=($S5W1="A") ; sub-test indicator is in column 5 of data records
; rating related keywords
$ENDIF
$Else (or else, conditionally)
this marks the start of keywords which are performed when the $If expression is false
Example 1: a datum is to be processed only if it is not blank.
DATUM = $S38E38 ; get a one character observation from the input file
$RATING = DATUM ; only do this if not blank - the Facform default
Example 2: any blank datum is to be recoded to 0.
DATUM = $S38E38 ; get a one character observation from the input file
$If = (DATUM<>" ") ; is it blank?
$RATING = DATUM ; only do this if not blank
$Else
$Rating = "0" ; output "0" instead of blank
$Endif ; end of $If keyword list
$Elseif=(expression) ($Else followed by $If)
this marks a $If expression to be performed when the previous $If expression is false
Example: set a variable to indicate examinee sex
Sex=$S24E25 ; Sex character M, F, or Blank in record
$IF=(Sex="F")
Sexvar=1 ; the numerical Sex variable
$ELSEIF=(Sex="M")
Sexvar=2
$ELSE
Sexvar=3 ; picks up invalid codes here
$ENDIF
$Label=4,Sexvar ; Used as element number in a Facet
Terminate and exit Facform when processing is completed.
This is useful in batch mode.
e.g.
runff.bat is
start /w c:\facets\facform HT0500FF.txt
start /w c:\facets\facform HT0595FF.txt
start /w c:\facets\facform HT0596FF.txt
start /w c:\facets\facform HT0597FF.txt
and each of the HT0500FF.txt files contains
$Batch=Yes
then executing runff.bat will cause each Facform process to occur in turn.
Help for Facform Rasch Measurement Software: www.winsteps.com.