|
Good Morning Friends,
I have a data management problem which I would love your help with. I've been given a data set that has to be restructured in order to assess inter-rater reliability. In the study video tapes of 31 children are examined for target behaviors (Beh). Each column represents the Child#, Rater#, and whether the rating is for Structure Play (sp) or Free Play (fp). Given this data set segment: Beh C1R1sp C1R2sp C1R1fp C1R2fp C2R1sp C2R2sp C2R1fp C2R2fp C3R1sp C3R2sp C3R1fp C3R2fp.. 1 4 4 4 5 5 4 5 4 3 5 4 5 2 5 5 5 5 3 5 4 5 4 4 3 2 3 3 4 4 5 5 5 4 4 4 4 5 3 How do I get SPSS to restructure it into so that the first column represents the child# and each column represents the Target Behavior#, Rater#, and whether the rating is for Structure Play (sp) or Free Play (fp). Child B1R1sp B1R2sp B1R1fp B1R2fp B2R1sp B2R2sp B2R1fp B2R2fp B3R1sp B3R2sp B3R1fp B3R2fp 1 4 4 4 5 5 5 5 5 3 3 4 4 2 5 4 5 4 3 5 4 5 5 5 4 4 3 3 5 4 5 4 4 3 2 4 4 5 3 The first step was easy. I FLIP the matrix so that I have 4 rows for each child by behavior. It's the next step that freezes my brain. Any help or suggestions will be greatly appreciated. Thank you, in advance, for any consideration you give to this problem. Stephen Salbod, Pace University, NYC ===================== 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 |
|
Stephen,
>>In the study video tapes of 31 children are examined for target behaviors (Beh). Each column represents the Child#, Rater#, and whether the rating is for Structure Play (sp) or Free Play (fp). Beh C1R1sp C1R2sp C1R1fp C1R2fp C2R1sp C2R2sp C2R1fp C2R2fp C3R1sp C3R2sp C3R1fp C3R2fp.. So, it looks like you have a 'wide format' file. But, if so, how does the 'Beh' variable relate to either structure play or free play? I'm thinking your explanation is shorter that it maybe should have been. >>How do I get SPSS to restructure it into so that the first column represents the child# and each column represents the Target Behavior#, Rater#, and whether the rating is for Structure Play (sp) or Free Play (fp). Child B1R1sp B1R2sp B1R1fp B1R2fp B2R1sp B2R2sp B2R1fp B2R2fp B3R1sp B3R2sp B3R1fp B3R2fp The first step was easy. I FLIP the matrix so that I have 4 rows for each child by behavior. It's the next step that freezes my brain. I don't claim to be an expert here but I think that you might better go at this by thinking of it as a varstocases problem followed by a casestovars probem. I think (and this is what I wanted to know about) that Beh is actually your case id variable. As such, you have as many cases as your coding system has target behaviors. (Actually, this reminds me of an Eyeberg setup, with one condition--clean up--missing.) Anyway, using varstocases, you go from Beh C1R1sp C1R2sp C1R1fp C1R2fp C2R1sp C2R2sp C2R1fp C2R2fp C3R1sp C3R2sp C3R1fp C3R2fp ... C75R2fp (Assume 75 kids and 10 target behaviors) Varstocases fixed=beh/null=keep/count=child/ make r1sp from c1r1sp c2r1sp ... C75r1sp/ >>repeat 'make' command for each combination of rater and play type<< *** warning: this ventures into territory that I haven't used before. The key problem is that you have to create a child id. I am assuming that you can do that by means of the count subcommand. I could easily be wrong but this would be what I would first try. The main problem is that the data entry design was poorly, poorly done. to Beh child R1sp R2sp R1fp r2fp. 1 1 To 1 75 2 1 To 10 75 You may need to do a rename variables command to get the var names back to what you want them to be. Then from this you go to Child b1r1sp ... b10r1sp b1r2sp ... B10r2sp b1r1fp ... b10r1fp b1r2fp ... B10r2fp Sort cases by child beh. Casestovars id=child/index=beh/groupby=variable. You may need to do rename variables command following the casetovars command to get the variable names adjusted correctly. Anyway, this is where I would start. I don't know if it will work perfectly. You'll need to test it and carefully examine your results. Gene Maguin ===================== 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 Salbod
At 12:12 PM 6/22/2008, Stephen Salbod wrote:
>I've a data set that has to be restructured in order to assess >inter-rater reliability. > > In the study video tapes of 31 children are > examined for target behaviors (Beh). Each column represents the > Child#, Rater#, and whether the rating is for Structure Play (sp) > or Free Play (fp). > >Given this data set segment [new test data -- see end of this posting]: |-----------------------------|---------------------------| |Output Created |23-JUN-2008 18:53:43 | |-----------------------------|---------------------------| C1R C1R C1R C1R C2R C2R C2R C2R C3R C3R C3R Beh 1sp 2sp 1fp 2fp 1sp 2sp 1fp 2fp 1sp 2sp 1fp C3R2fp SPACE 101 2.3 2.2 1.0 2.4 3.4 2.6 1.5 3.6 3.5 1.1 1.9 2.1 102 2.8 1.4 1.3 3.5 2.9 3.4 1.9 1.2 2.3 1.7 3.8 2.0 103 2.0 1.5 3.9 2.9 1.5 4.0 2.2 3.2 1.1 2.6 2.0 2.8 Number of cases read: 3 Number of cases listed: 3 >How do I get SPSS to restructure it [...] As Gene Maguin wrote at 01:19 PM 6/23/2008: >I think that you might think of it as a varstocases problem followed >by a casestovars probem. The key problem is that you have to create a child id. For this, you use the INDEX subcommand on VARSTOCASES. The following VARSTOCASES syntax was clicked up, pasted, and reformatted: VARSTOCASES /MAKE Rating FROM C1R1sp C1R2sp C1R1fp C1R2fp C2R1sp C2R2sp C2R1fp C2R2fp C3R1sp C3R2sp C3R1fp C3R2fp /INDEX = Child "Child number; you have 3"(3) Condition "1=structured,2=free" (2) Rater "You have two raters" (2) /KEEP = Beh /NULL = KEEP. Variables to Cases |-----------------------------|---------------------------| |Output Created |23-JUN-2008 19:09:23 | |-----------------------------|---------------------------| Generated Variables |---------|---------------| |Name |Label | |---------|---------------| |Child |Child number; | | |you have 3 | |---------|---------------| |Condition|1=structured,2=| | |free | |---------|---------------| |Rater |You have two | | |raters | |---------|---------------| |Rating |<none> | |---------|---------------| LIST. List |-----------------------------|---------------------------| |Output Created |23-JUN-2008 19:09:23 | |-----------------------------|---------------------------| Beh Child Condition Rater Rating 101 1 1 1 2.3 101 1 1 2 2.2 101 1 2 1 1.0 101 1 2 2 2.4 101 2 1 1 3.4 101 2 1 2 2.6 [...] 103 3 1 1 1.1 103 3 1 2 2.6 103 3 2 1 2.0 103 3 2 2 2.8 Number of cases read: 36 Number of cases listed: 36 Then, as Gene continued, >Sort cases by child beh. >Casestovars id=child/index=beh/groupby=variable. Exactly, though the CASESTOVARS needs to be a little more elaborate. This is clicked up, reformatted, and run, without doing anything about the variable names. >You may need to do rename variables command following the casetovars >command to get the variable names adjusted correctly. You can come pretty close, by recoding to get 'condition' as a two-character code ('fp' or 'sp'), shortening the data name from 'Rating' to 'R', and using a null separator: STRING CondCode (A2). RECODE Condition (1='sp') (2='fp') INTO CondCode. SORT CASES BY Child Beh CondCode Rater . CASESTOVARS /RENAME Rating=R /ID = Child /INDEX = Beh CondCode Rater /SEPARATOR = '' /GROUPBY = VARIABLE /DROP = Condition. Cases to Variables |-----------------------------|---------------------------| |Output Created |23-JUN-2008 19:51:55 | |-----------------------------|---------------------------| [ToWide] Generated Variables |--------|---|--------|---------------|-------| |Original|Beh|CondCode|Rater You have|Result | |Variable| | |two raters |-------| | | | | |Name | |--------|---|--------|---------------|-------| |Rating |101|fp |1 |R101fp1| | | | |2 |R101fp2| | | |--------|---------------|-------| | | |sp |1 |R101sp1| | | | |2 |R101sp2| | |---|--------|---------------|-------| | |102|fp |1 |R102fp1| | | | |2 |R102fp2| | | |--------|---------------|-------| | | |sp |1 |R102sp1| | | | |2 |R102sp2| | |---|--------|---------------|-------| | |103|fp |1 |R103fp1| | | | |2 |R103fp2| | | |--------|---------------|-------| | | |sp |1 |R103sp1| | | | |2 |R103sp2| |--------|---|--------|---------------|-------| Processing Statistics |---------------|----| |Cases In |36 | |Cases Out |3 | |---------------|----| |Variables In |6 | |Variables Out |13 | |---------------|----| |Index Values |12 | |---------------|----| TEMPORARY. STRING SPACE (A24). LIST Child TO R103sp2 SPACE. List |-----------------------------|---------------------------| |Output Created |23-JUN-2008 19:51:56 | |-----------------------------|---------------------------| [ToWide] R10 R10 R10 R10 R10 R10 R10 R10 R10 Chil 1fp 1fp 1sp 1sp 2fp 2fp 2sp 2sp 3fp R103 R103 R103 d 1 2 1 2 1 2 1 2 1 fp2 sp1 sp2 SPACE 1 2.4 3.4 2.2 1.0 3.5 2.9 1.4 1.3 2.9 1.5 1.5 3.9 2 3.6 3.5 2.6 1.5 1.2 2.3 3.4 1.9 3.2 1.1 4.0 2.2 3 2.1 2.8 1.1 1.9 2.0 2.0 1.7 3.8 2.8 2.8 2.6 2.0 Number of cases read: 3 Number of cases listed: 3 ============================= APPENDIX: Test data, and code ============================= * ................................................................. . * ................. Test data ..................... . SET RNG = MT /* 'Mersenne twister' random number generator */ . SET MTINDEX = 3432 /* Providence, RI telephone book */ . NEW FILE. INPUT PROGRAM. . NUMERIC Beh (F3). . NUMERIC C1R1sp C1R2sp C1R1fp C1R2fp C2R1sp C2R2sp C2R1fp C2R2fp C3R1sp C3R2sp C3R1fp C3R2fp (F3.1). . LOOP Beh = 101 TO 103. . DO REPEAT DATUM = C1R1sp TO C3R2fp. . COMPUTE DATUM = RV.UNIFORM(1,4). . END REPEAT. . END CASE. . END LOOP. END FILE. END INPUT PROGRAM. TEMPORARY. STRING SPACE (A24). LIST Beh TO C3R2Fp SPACE. VARSTOCASES /MAKE Rating FROM C1R1sp C1R2sp C1R1fp C1R2fp C2R1sp C2R2sp C2R1fp C2R2fp C3R1sp C3R2sp C3R1fp C3R2fp /INDEX = Child "Child number; you have 3"(3) Condition "1=structured,2=free" (2) Rater "You have two raters" (2) /KEEP = Beh /NULL = KEEP. LIST. DATASET NAME Long WINDOW=FRONT. DATASET ACTIVATE Long WINDOW=FRONT. DATASET COPY ToWide. DATASET ACTIVATE ToWide WINDOW=FRONT. STRING CondCode (A2). RECODE Condition (1='sp') (2='fp') INTO CondCode. SORT CASES BY Child Beh CondCode Rater . CASESTOVARS /RENAME Rating=R /ID = Child /INDEX = Beh CondCode Rater /SEPARATOR = '' /GROUPBY = VARIABLE /DROP = Condition. TEMPORARY. STRING SPACE (A24). LIST Child TO R103sp2 SPACE. ===================== 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 |
