Loading... |
Reply to author |
Edit post |
Move post |
Delete this post |
Delete this post and replies |
Change post date |
Print post |
Permalink |
Raw mail |
![]() ![]() ![]() ![]() ![]() ![]() ![]() |
12 posts
|
Dear Listserv,
I have a data file: ID Visit antidepressant 101 1 name 101 1 name 101 2 name 101 4 name 102 1 name 102 1 name . . . . Could someone please help me create syntax so that each ID will only have 1 line of data for a visit. For example, I only want ID 101 to have one line for Visit 1, 2, and 4. At this point I do not care about the name of the drug. I just want to know whether a subject was on a antidepressant at each of their visits. Many thanks for your help in advance, leah |
Loading... |
Reply to author |
Edit post |
Move post |
Delete this post |
Delete this post and replies |
Change post date |
Print post |
Permalink |
Raw mail |
![]() ![]() ![]() ![]() ![]() ![]() ![]() |
Administrator
3809 posts
|
See AGGREGATE command!
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?" |
Loading... |
Reply to author |
Edit post |
Move post |
Delete this post |
Delete this post and replies |
Change post date |
Print post |
Permalink |
Raw mail |
![]() ![]() ![]() ![]() ![]() ![]() ![]() |
209 posts
|
In reply to this post by leah rubin
Dataset activate yourdata.
Dataset declare pervisit. Aggregate outfile = pervisit /break = Id visit /antidepressant = First (antidepressant) . Dataset activate pervisit window = front. Jim Marks From: SPSSX(r) Discussion <[hidden email]> To: [hidden email] <[hidden email]> Sent: Thu Feb 02 11:16:54 2012 Subject: Syntax help needed to rearrange database I have a data file: ID Visit antidepressant 101 1 name 101 1 name 101 2 name 101 4 name 102 1 name 102 1 name . . . . Could someone please help me create syntax so that each ID will only have 1 line of data for a visit. For example, I only want ID 101 to have one line for Visit 1, 2, and 4. At this point I do not care about the name of the drug. I just want to know whether a subject was on a antidepressant at each of their visits. Many thanks for your help in advance, leah |
Loading... |
Reply to author |
Edit post |
Move post |
Delete this post |
Delete this post and replies |
Change post date |
Print post |
Permalink |
Raw mail |
![]() ![]() ![]() ![]() ![]() ![]() ![]() |
51 posts
|
In reply to this post by leah rubin
You can use DATA>RESTRUCTURE>SELECTED CASES TO VARIABLES
and on the next screen index on ID. Arthur Kramer "Believe half of what you
see and none of what you hear." N. Whitfield B. Strong From: SPSSX(r) Discussion
[mailto:[hidden email]] On Behalf Of leah rubin Dear Listserv, |
Free forum by Nabble | Edit this page |