Hi, I´m stack with a problem selecting cases.
My database is organized as a repeated measures design, but with hundreds of variables. I´m looking for something simple but hard to explain, I´ll try. It´s organized as if I were going to make a multilevel analysis (indeed I will do), but I want to make as well cross-sectional analysis and I have a thousand variables, and 2000 lines, so it would be complicated to have a single line per case. So, now: -Each Row is a patient (indexed with a string), and has another variable defining "week number" of the assessment. -Each patient has been assessed in different weeks, and each row in the SPSS is A WEEK. I will design lots of cut-points and definitions for each week depending of sets of variables, so I can select each week as a case, i.e. "depressed week". So, I want to select all the rows that belong to patients (defined as a "string") who has had in ANY week, the outcome "depressed week" as positive. I've tryed to make conditions in recoding or calculating variables but I cannot fin the adequate phormula for selecting them. I want to make it automatically with syntax because the sample is big and I will repeat it again with different definitions many times to select cases and then make analysis and comparisons with that groups. Thanks for helping a data mining beginner!! |
Let's get some basics established. I think your dataset looks like this.
PatientID week Depressed x1 ... xn Aa11 1 0 (values for x1 to xn, which may change from week to week or not) Aa11 2 1 (values for x1 to xn) Aa11 3 1 (values for x1 to xn) Ba21 1 1 (values for x1 to xn) Etc (or not). So why won't this work? Select if (depressed eq 1). Gene Maguin -----Original Message----- From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of caoticospss Sent: Saturday, February 08, 2014 8:17 AM To: [hidden email] Subject: Selecting cases in a multilevel repeated measures datasheet Hi, I´m stack with a problem selecting cases. My database is organized as a repeated measures design, but with hundreds of variables. I´m looking for something simple but hard to explain, I´ll try. It´s organized as if I were going to make a multilevel analysis (indeed I will do), but I want to make as well cross-sectional analysis and I have a thousand variables, and 2000 lines, so it would be complicated to have a single line per case. So, now: -Each Row is a patient (indexed with a string), and has another variable defining "week number" of the assessment. -Each patient has been assessed in different weeks, and each row in the SPSS is A WEEK. I will design lots of cut-points and definitions for each week depending of sets of variables, so I can select each week as a case, i.e. "depressed week". *So, I want to select all the rows that belong to patients (defined as a "string") who has had in ANY week, the outcome "depressed week" as positive. * I've tryed to make conditions in recoding or calculating variables but I cannot fin the adequate phormula for selecting them. I want to make it automatically with syntax because the sample is big and I will repeat it again with different definitions many times to select cases and then make analysis and comparisons with that groups. Thanks for helping a data mining beginner!! -- View this message in context: http://spssx-discussion.1045642.n5.nabble.com/Selecting-cases-in-a-multilevel-repeated-measures-datasheet-tp5724376.html Sent from the SPSSX Discussion mailing list archive at Nabble.com. ===================== 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 |
Administrator
|
But the OP wrote:
So, I want to select all the rows that belong to patients (defined as a "string") who has had in ANY week, the outcome "depressed week" as positive. So I think you need to first use AGGREGATE (breaking on PatientID) to get the MAX value of Depressed (assuming Depressed is shown as in Gene's example, with 1=Yes, 0=No). Suppose that new variable is called AnyDepression. Then... SELECT if AnyDepression. EXECUTE. HTH.
--
Bruce Weaver bweaver@lakeheadu.ca http://sites.google.com/a/lakeheadu.ca/bweaver/ "When all else fails, RTFM." PLEASE NOTE THE FOLLOWING: 1. My Hotmail account is not monitored regularly. To send me an e-mail, please use the address shown above. 2. The SPSSX Discussion forum on Nabble is no longer linked to the SPSSX-L listserv administered by UGA (https://listserv.uga.edu/). |
Administrator
|
To OP:
Since you really don't describe your data very well it is very difficult to advise. If your data are in long format then using AGGREGATE as Bruce suggests is the path. BUT do look into the MODE modifier in the manual. Specify MODE=ADDsomething? Yeah, look it up! ---
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 caoticospss
Thanks to Eugene, Bruce, and David. Sorry for the delay in answering but I was travelling and without good conexion to work.
The data is organized as you describe (now I have learned that is called "long format" vs. wide typical one). I have learned to used the AGGREGATE function and it worked. In MODE it worked with funcion MAX (even if one patient has more than one positive week, still gives me a 1, for some reason). Thanks to everyone! |
Free forum by Nabble | Edit this page |