|
I have a dataset of children's item-level responses on a standardized
test. For this test, there is a discontinue criterion, meaning, if the child got more than a certain number of the items wrong the assessor was supposed to discontinue administration. Is there a function/syntax I can use that searches each child's data serially until it finds six consecutive 0's, and then returns the variable name at which the sixth 0 occurs for that child? Thanks in advance, Ellen ===================== To manage your subscription to SPSSX-L, send a message to [hidden email] (not to SPSSX-L), with no body text except the command. To leave the list, send the command SIGNOFF SPSSX-L For a list of commands to manage subscriptions, send the command INFO REFCARD |
|
Ellen ... For N items administered serially there are (N-5) ways of
getting six consecutive 0s. So a brute-force solution is to write N-5 compute statements of the form: COMPUTE I6_Wrong = SUM(Item1 TO Item6)=0. COMPUTE I7_Wrong = SUM(Item2 TO Item7)=0. etc So I6_Wrong = 1 when the first six items are 0s and I7_Wrong=1 when items 2-7 are 0s. Nothing elegant about this, but it will do what you want. Art Art Burke Northwest Regional Educational Laboratory 101 SW Main St, Suite 500 Portland, OR 97204-3213 _______________________________________________________________ -----Original Message----- From: Ellen Hamilton Newman [mailto:[hidden email]] Sent: Friday, August 08, 2008 9:00 AM To: [hidden email] Subject: Searching for the discontinue point I have a dataset of children's item-level responses on a standardized test. For this test, there is a discontinue criterion, meaning, if the child got more than a certain number of the items wrong the assessor was supposed to discontinue administration. Is there a function/syntax I can use that searches each child's data serially until it finds six consecutive 0's, and then returns the variable name at which the sixth 0 occurs for that child? Thanks in advance, Ellen ===================== To manage your subscription to SPSSX-L, send a message to [hidden email] (not to SPSSX-L), with no body text except the command. To leave the list, send the command SIGNOFF SPSSX-L For a list of commands to manage subscriptions, send the command INFO REFCARD |
|
In reply to this post by Ellen Hamilton Newman
One technique is to create a string containing all the responses, either by
converting each score to a string value (if they are not already strings) or by doing an additional read of the text data, if you have access to it. Then use the INDEX function to search the string for the first occurrence of "000000". Adding 5 to the output of the index function would give you the position of the variable at which the sixth zero score occurred. This assumes the responses are scored as single digits. David Wasserman -----Original Message----- From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of Ellen Hamilton Newman Sent: August-08-08 10:00 AM To: [hidden email] Subject: Searching for the discontinue point I have a dataset of children's item-level responses on a standardized test. For this test, there is a discontinue criterion, meaning, if the child got more than a certain number of the items wrong the assessor was supposed to discontinue administration. Is there a function/syntax I can use that searches each child's data serially until it finds six consecutive 0's, and then returns the variable name at which the sixth 0 occurs for that child? Thanks in advance, Ellen ===================== To manage your subscription to SPSSX-L, send a message to [hidden email] (not to SPSSX-L), with no body text except the command. To leave the list, send the command SIGNOFF SPSSX-L For a list of commands to manage subscriptions, send the command INFO REFCARD ===================== To manage your subscription to SPSSX-L, send a message to [hidden email] (not to SPSSX-L), with no body text except the command. To leave the list, send the command SIGNOFF SPSSX-L For a list of commands to manage subscriptions, send the command INFO REFCARD |
|
In reply to this post by Ellen Hamilton Newman
At 11:59 AM 8/8/2008, Ellen Hamilton Newman wrote:
>Is there a function/syntax I can use that searches each child's data >serially until it finds six consecutive 0's, and then returns the >variable name at which the sixth 0 occurs for that child? This is a quick try, untested. (And it may need testing and revision; it's complex enough, that I could easily make a mistake.) It assumes that the response variables are contiguous in the dataset, so they can be made a vector; and it returns the *number* of the start of the first run of 6 consecutive zeroes. In this logic, a missing value is not counted as a 0. It would be easy to revise, so that it did count as a zero. NUMERIC DisCont (F4). VAR LABEL DisCont 'Number of question that begins 1st run of 6+ zeroes'. * This is written for 999 response variables. Correct . * for the variable names and the number of response . * variables in your data. . NUMERIC #RunStrt /* Beginning of current run of zeroes */ #RunLen /* Length of current run, so far */ (F4). VECTOR Response=Resp001 TO Resp999. * Initialize: begin as if there's a response # 000, . * and its value is not 0. . COMPUTE #RunStrt = 0. COMPUTE #RunLen = 0. * Initialize: there is no run of 6+ consecutive zeroes . COMPUTE DisCont = 0. LOOP #R = 1 TO 999. . DO IF MISSING(Response(#R)) OR Response(#R) NE 0. . COMPUTE #RunStrt = 0. . COMPUTE #RunLen = 0. . ELSE /* here, the current response is 0 */. . IF #RunStrt EQ 0 #RunStrt = #R. . COMPUTE #RunLen = #RunLen + 1. . END IF. . IF #RunLen GE 6 DisCont = #RunStrt. . END IF. END LOOP IF DisCont GT 0. ===================== To manage your subscription to SPSSX-L, send a message to [hidden email] (not to SPSSX-L), with no body text except the command. To leave the list, send the command SIGNOFF SPSSX-L For a list of commands to manage subscriptions, send the command INFO REFCARD |
| Free forum by Nabble | Edit this page |
