Restructuring Data

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Restructuring Data

bdates
I have a dataset which I would like to restructure with the ID as the case, Domain Number as the variable, and Status as the score for each Domain. There are 12 Domain Numbers, and not all subjects have scores on each Domain. For example, Subject 796 has scores on Domains 6 and 8 while Subject 808 has scores on Domains 6, 7, and 8. I've tried various combinations but none are working. Thanks in advance.

Raw Data

ID     Domain  Status
796       6            1
796       8            2
808       6            2
808       7            2
808       8            1


Restructured Data

ID    Domain1     Domain2     Domain3     Domain4     Domain5     Domain6     Domain7     Domain8     Domain2     Domain10     Domain11     Domain12
796                                                                                                                  1                                         2
808                                                                                                                  2                    2                   1



Brian
===================== 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
Reply | Threaded
Open this post in threaded view
|

Re: Restructuring Data

Mario Giesel-2
Hi, Brian.

CASESTOVARS /ID = id /INDEX = Domain.

Mario Giesel
Munich, Germany


Am Montag, 27. April 2020, 22:59:33 MESZ hat Dates, Brian <[hidden email]> Folgendes geschrieben:


I have a dataset which I would like to restructure with the ID as the case, Domain Number as the variable, and Status as the score for each Domain. There are 12 Domain Numbers, and not all subjects have scores on each Domain. For example, Subject 796 has scores on Domains 6 and 8 while Subject 808 has scores on Domains 6, 7, and 8. I've tried various combinations but none are working. Thanks in advance.

Raw Data

ID     Domain  Status
796       6            1
796       8            2
808       6            2
808       7            2
808       8            1


Restructured Data

ID    Domain1     Domain2     Domain3     Domain4     Domain5     Domain6     Domain7     Domain8     Domain2     Domain10     Domain11     Domain12
796                                                                                                                  1                                         2
808                                                                                                                  2                    2                   1



Brian
===================== 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
Reply | Threaded
Open this post in threaded view
|

Re: Restructuring Data

bdates
Mario,

Perfect! Thanks.

Brian

From: Mario Giesel <[hidden email]>
Sent: Tuesday, April 28, 2020 1:17 AM
To: [hidden email] <[hidden email]>; Dates, Brian <[hidden email]>
Subject: Re: Restructuring Data
 
Hi, Brian.

CASESTOVARS /ID = id /INDEX = Domain.

Mario Giesel
Munich, Germany


Am Montag, 27. April 2020, 22:59:33 MESZ hat Dates, Brian <[hidden email]> Folgendes geschrieben:


I have a dataset which I would like to restructure with the ID as the case, Domain Number as the variable, and Status as the score for each Domain. There are 12 Domain Numbers, and not all subjects have scores on each Domain. For example, Subject 796 has scores on Domains 6 and 8 while Subject 808 has scores on Domains 6, 7, and 8. I've tried various combinations but none are working. Thanks in advance.

Raw Data

ID     Domain  Status
796       6            1
796       8            2
808       6            2
808       7            2
808       8            1


Restructured Data

ID    Domain1     Domain2     Domain3     Domain4     Domain5     Domain6     Domain7     Domain8     Domain2     Domain10     Domain11     Domain12
796                                                                                                                  1                                         2
808                                                                                                                  2                    2                   1



Brian
===================== 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