Greetings, I’m working with a dataset that contains pre and post surveys (coded 1 or 2 under “admin type”) for the same participants so there are duplicate participant #s. When I restructure the data I use the participant# as my only identifier.
However after the restructure 2 of the survey questions do not restructure by admin type. So instead of q2.1, q2.2, etc. I have the questions in their original format. Any ideas why? All the questions started out as strings so I changed them to numeric before
the restructure but this resulted in the same thing. I’m flummoxed… Jason May, MS Evaluation Analyst, Learning & Performance Improvement Beech Brook P: 216-831-8520 x2389 F: 216-831-0436 |
Jason,
Could you please provide an example of how your data look prior to restructuring and how you would like them to look afterward? Thanks.
Brian
From: SPSSX(r) Discussion [[hidden email]] on behalf of May, Jason [[hidden email]]
Sent: Monday, January 20, 2014 2:31 PM To: [hidden email] Subject: Restructured dataset confusion Greetings,
I’m working with a dataset that contains pre and post surveys (coded 1 or 2 under “admin type”) for the same participants so there are duplicate participant #s. When I restructure the data I use the participant# as my only identifier. However after the restructure 2 of the survey questions do not restructure by admin type. So instead of q2.1, q2.2, etc. I have the questions in their original format. Any ideas why? All the questions started out as strings so I changed them to numeric before the restructure but this resulted in the same thing. I’m flummoxed…
Jason May, MS Evaluation Analyst, Learning & Performance Improvement Beech Brook P: 216-831-8520 x2389 F: 216-831-0436
|
In reply to this post by jam320
So the data structure is:
ID ADMIN 1 1 1 2 2 1 2 2 3 1 3 2 Is that correct? Rick Oliver Senior Information Developer IBM Business Analytics (SPSS) E-mail: [hidden email] From: "May, Jason" <[hidden email]> To: [hidden email], Date: 01/20/2014 01:36 PM Subject: Restructured dataset confusion Sent by: "SPSSX(r) Discussion" <[hidden email]> Greetings, I’m working with a dataset that contains pre and post surveys (coded 1 or 2 under “admin type”) for the same participants so there are duplicate participant #s. When I restructure the data I use the participant# as my only identifier. However after the restructure 2 of the survey questions do not restructure by admin type. So instead of q2.1, q2.2, etc. I have the questions in their original format. Any ideas why? All the questions started out as strings so I changed them to numeric before the restructure but this resulted in the same thing. I’m flummoxed… Jason May, MS Evaluation Analyst, Learning & Performance Improvement Beech Brook P: 216-831-8520 x2389 F: 216-831-0436 CONFIDENTIALITY NOTE: Please be aware that e-mail communication can be intercepted in transmission or misdirected. Please consider communicating any sensitive information by telephone, fax, or mail. The information contained in this message may be privileged and confidential. If you are NOT the intended recipient, please notify Beech Brook immediately at (216) 831-2255 and destroy this message.
|
In reply to this post by jam320
Something like this?
data list list /id admin testresult. begin data 1 1 82 1 2 89 2 1 75 2 2 72 3 1 55 3 2 75 end data. SORT CASES BY id admin. CASESTOVARS /ID=id /INDEX=admin /GROUPBY=VARIABLE. Rick Oliver Senior Information Developer IBM Business Analytics (SPSS) E-mail: [hidden email] From: Rick Oliver/Chicago/IBM To: "May, Jason" <[hidden email]>, Cc: [hidden email] Date: 01/20/2014 01:41 PM Subject: Re: Restructured dataset confusion So the data structure is: ID ADMIN 1 1 1 2 2 1 2 2 3 1 3 2 Is that correct? Rick Oliver Senior Information Developer IBM Business Analytics (SPSS) E-mail: [hidden email] From: "May, Jason" <[hidden email]> To: [hidden email], Date: 01/20/2014 01:36 PM Subject: Restructured dataset confusion Sent by: "SPSSX(r) Discussion" <[hidden email]> Greetings, I’m working with a dataset that contains pre and post surveys (coded 1 or 2 under “admin type”) for the same participants so there are duplicate participant #s. When I restructure the data I use the participant# as my only identifier. However after the restructure 2 of the survey questions do not restructure by admin type. So instead of q2.1, q2.2, etc. I have the questions in their original format. Any ideas why? All the questions started out as strings so I changed them to numeric before the restructure but this resulted in the same thing. I’m flummoxed… Jason May, MS Evaluation Analyst, Learning & Performance Improvement Beech Brook P: 216-831-8520 x2389 F: 216-831-0436 CONFIDENTIALITY NOTE: Please be aware that e-mail communication can be intercepted in transmission or misdirected. Please consider communicating any sensitive information by telephone, fax, or mail. The information contained in this message may be privileged and confidential. If you are NOT the intended recipient, please notify Beech Brook immediately at (216) 831-2255 and destroy this message.
|
Administrator
|
In reply to this post by jam320
Hey Flummoxed!
POST YOUR SYTNTAX next time you encounter issues! ALSO an example of pre and post data! Any ideas why? You have NO VARIATION in your t1-t2 responses within your ID variable! Meanwhile, look up the AUTOFIX subcommand for CASESTOVARS. Later!
Please reply to the list and not to my personal email.
Those desiring my consulting or training services please feel free to email me. --- "Nolite dare sanctum canibus neque mittatis margaritas vestras ante porcos ne forte conculcent eas pedibus suis." Cum es damnatorum possederunt porcos iens ut salire off sanguinum cliff in abyssum?" |
In reply to this post by jam320
At 02:31 PM 1/20/2014, May, Jason wrote:
>Im working with a dataset that contains pre and >post surveys (coded 1 or 2 under admin type) >for the same participants so there are duplicate participant #s. So, in general you have two records per participant; and "admin type" identifies them as pre- or post-surveys. >When I restructure the data I use the >participant# as my only identifier. However >after the restructure 2 of the survey questions >do not restructure by admin type. So instead of >q2.1, q2.2, etc. I have the questions in their original format. This can happen if, for those questions, all participants responded the same on the pre- and post-test. CASESTOVARS takes those as 'fixed' variables and, indeed, doesn't restructure them. Try adding subcommand /AUTOFIX = NO to your CASESTOVARS. > Any ideas why? All the questions started out > as strings so I changed them to numeric before > the restructure but this resulted in the same thing. Im flummoxed > >Jason May, MS >Evaluation Analyst, Learning & Performance Improvement >Beech Brook >P: 216-831-8520 x2389 >F: 216-831-0436 > >CONFIDENTIALITY NOTE: Please be aware that >e-mail communication can be intercepted in >transmission or misdirected. Please consider >communicating any sensitive information by >telephone, fax, or mail. The information >contained in this message may be privileged and >confidential. If you are NOT the intended >recipient, please notify Beech Brook immediately >at (216) 831-2255 and destroy this message. ===================== 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 |
At 09:14 AM 1/21/2014, May, Jason wrote, off-list:
>Thanks for the reply. Where would I supply [the command "/AUTOFIX = >NO"]? I am not familiar with input scripts. OK -- you're working with the menus, only, to do your restructuring. You'll have to go beyond that, and work with syntax a little. Start SPSS and load the file you want to restructure, just as you did before. Here's a short test dataset that I'm making for this posting. In it, questions 1 and 2 have the problem you're probably running into: for every participant, they're the same on the pre- and post-test: |-----------------------------|----------------------------| |Output Created |23-JAN-2014 00:42:31 | |-----------------------------|----------------------------| [TestData] Pcptnt AdmType q1 q2 q3 q4 1001 1 1 2 5 1 1001 2 1 2 5 2 1002 1 5 4 2 1 1002 2 5 4 5 3 1003 1 3 2 3 5 1003 2 3 2 1 5 1004 1 4 2 1 2 1004 2 4 2 4 1 1005 1 3 2 2 1 1005 2 3 2 5 3 1006 1 3 5 5 1 1006 2 3 5 2 3 Number of cases read: 12 Number of cases listed: 12 1. Open a syntax window, if you don't have one already: on the menu bar at the top of any SPSS window, click "File -> New -> Syntax". 2. Go through the restructuring. (In this dataset, I went into the menus and selected "Data -> Restructure -> Restructure selected cases into variables" Then, I chose "Pcptnt" as identifier variable, and "AdmType" as index variable; you'll do something similar with your data.) Do NOT click "Finish" in the next window, "Cases to Variables: Sorting Data". Click "Next", then click "Next" in the window after that, and you should get to a window headed "Finish". In that window, select "Paste the syntax generated by the wizard into a syntax window", and *then* click "Finish". 3. Click on the syntax window you opened. In it, you'll see a SORT CASES and a CASESTOVARS statement; the ones from this test data looked like this: SORT CASES BY Pcptnt AdmType . CASESTOVARS /ID = Pcptnt /INDEX = AdmType /GROUPBY = VARIABLE . Add the "/AUTOFIX=NO" to the CASESTOVARS statement, so they look like this: SORT CASES BY Pcptnt AdmType . CASESTOVARS /ID = Pcptnt /INDEX = AdmType /AUTOFIX = NO /GROUPBY = VARIABLE . Select the SORT CASES and CASESTOVARS statements together, and click the right-pointing triangle -- it means "Run" -- in the second menu bar at the top of the syntax window. That should do it; see below: Test data, restructured without "/AUTOFIX = NO": |-----------------------------|----------------------------| |Output Created |23-JAN-2014 00:44:29 | |-----------------------------|----------------------------| [Restruct1] Pcptnt q1 q2 q3.1 q3.2 q4.1 q4.2 1001 1 2 5 5 1 2 1002 5 4 2 5 1 3 1003 3 2 3 1 5 5 1004 4 2 1 4 2 1 1005 3 2 2 5 1 3 1006 3 5 5 2 1 3 Number of cases read: 6 Number of cases listed: 6 Test data, restructured with "/AUTOFIX = NO": |-----------------------------|---------------------------| |Output Created |23-JAN-2014 00:48:18 | |-----------------------------|---------------------------| [Restruct2] Pcptnt q1.1 q1.2 q2.1 q2.2 q3.1 q3.2 q4.1 q4.2 1001 1 1 2 2 5 5 1 2 1002 5 5 4 4 2 5 1 3 1003 3 3 2 2 3 1 5 5 1004 4 4 2 2 1 4 2 1 1005 3 3 2 2 2 5 1 3 1006 3 3 5 5 5 2 1 3 Number of cases read: 6 Number of cases listed: 6 ===================== 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 |