|
SPSS listers:
I have selected hematopoietic stem cell transplantation (HSCT) encounters from 2001 to 2006 population-based data sets. There are duplicate cases with the same id and admission day due to monthly claims data and longer hospitalization days. The maximum number of duplicate cases is 7 records per encounter. Is there any way to create syntax for merging duplicate cases as one record (index) per encounter and obtain studied variables? Could someone show me how to use syntax instead of using manual summation and work? Studied variables are ICD-9-CM diagnositc codes related to comorbidity on the 1st record, ICD-9-CM diagnostic codes related to complications on the 1st, 2nd, 3rd..., & 7th records, ICD-9-CM procedure related to a variety of procedures on the 1st... & 7th records, total length of stay (LOS by summing each record), discharge status (e.g., discharge, outpatient follow-up, discharge against advice, dead, transfer...) on the last record, different fee (e.g., diagnosis fee, room fee, drug fee, injection fee..., & total fee), and sex. Appreciate. Amy ===================== 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 |
|
Amy,
There's so much I don't understand about your datasets, it's hard to know where to start. Maybe here. It sounds like id and admission day define a duplicate case. Can the same id and admission date appear in the 2001 and 2002 datasets, for instance? If so, you have to add the files together. Look at add files. Suppose the six datasets were added together and sorted by id and admission day. Are you saying that all other data on the 'x' many records in the set of records having the same id and admission day are 1) the same, exactly the same, in which case any record in the set is the same as any other record in the set or 2) some data are the same and some data are different on all records in the set or 3) all data are different on all records in the set? If 1) and you want to use syntax, you could do Compute pick=1. If (id eq lag(id) and admit_date eq lag(admit_date)) pick=lag(pick)+1. Select if (pick eq 1). If 2) or 3), you might use aggregate or casestovars, depending on what exactly you needed. There's just not enough information supplied to be specific, although aggregate may be more relevant. >>Studied variables are ICD-9-CM diagnositc codes related to comorbidity on the 1st record, Use the first function on aggregate, i.e., ... Icd1=first(icd1)/ By the way, how do you know which record is the 'first' record?? >>ICD-9-CM diagnostic codes related to complications on the 1st, 2nd, 3rd..., & 7th records, >>ICD-9-CM procedure related to a variety of procedures on the 1st... & 7th records, total length of stay (LOS by summing each record), Hard to know what you want to do with the diag and proc codes on the records and what you want to do matters for selecting the procedure. Others may have a better idea here but I don't think you can necessarily do anything useful with aggregate unless you are focusing on specific codes. Length of stay is gotten by using the sum function on aggregate. >>discharge status (e.g., discharge, outpatient follow-up, discharge against advice, dead, transfer...) on the last record, >>Different fee (e.g., diagnosis fee, room fee, drug fee, injection fee..., & total fee), and sex. Discharge status can be gotten by using the last function from aggregate. The fee data. Again, hard to know what to do because it depends on what you want to know. Overall, I guess my suggestion would be go through all your variables and identify what you want to know about each variable given a set of records with the same id and admit date. Once you have that list, look at the aggregate command and see if you can match up what you need against the functions supplied in the command. What you can't match up, come back and repost to the list describing the variables and desired result. 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 Suh-Ing Amy Hsieh
Jon,
Thank you for your offer to make the codebook for me. To all who replied: thank you. It turns out that there is hard way to do it. I think I've done it now (but I've already thought that several times today). 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 Suh-Ing Amy Hsieh
Previously, syntax files displayed in Notepad in the same manner as they do
in the spss syntax editor. But now they do not. I understand it's a trivial thing but notepad is useful for scanning through files without having to start up spss itself and, I guess, some folks use notepad to edit syntax files. It seems as though notepad doesn't recognize or process the end of line (EOL) or end of record (EOR) marker correctly anymore. That makes me wonder if the EOL or EOR character has been changed--for some reason. However, v16 syntax files display correctly on an editor like multiedit. Why the issue for one program but not another. So, I'm curious (but with a little edge) as to why this is. Does anyone know? I'm also curious as to whether this is true for 17 as well. 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 |
|
Gene, I was able to work with Notepad+ and V16 syntax and also can with V17
but in V17 when I zip and compress the syntax it becomes corrupt so simply have to zip "as is" WMB Statistical Services ============ mailto: [hidden email] http:\\home.earthlink.net\~info.statman ============ On 11/4/2008 9:28:53 AM, Gene Maguin ([hidden email]) wrote: > Previously, syntax files displayed in Notepad in the same manner as they > do > in the spss syntax editor. But now they do not. I understand > it's a trivial > thing but notepad is useful for scanning through files without having to > start up spss itself and, I guess, some folks use notepad to edit syntax > files. It seems as though notepad doesn't > recognize or process the end of > line (EOL) or end of record (EOR) marker correctly anymore. That makes me > wonder if the EOL or EOR character has been changed--for some reason. > However, v16 syntax files display correctly on an editor like multiedit. > Why > the issue for one program but not another. > > So, > I'm curious (but with a little edge) as to why this is. Does anyone > know? I'm > also curious as to whether this is true for 17 as well. > > 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 ===================== 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
Will
Statistical Services ============ info.statman@earthlink.net http://home.earthlink.net/~z_statman/ ============ |
|
I don't use Notepad+, but I note that it says in the readme,
"meant for plain text files only. It's not for binary files, files that use escape characters, etc. Chances are files with escape characters won't show up properly. It's meant for plain, person-readable text only. " This makes me suspect that it will not do well with Unicode syntax files or maybe even code page files that contain extended characters. You can choose in SPSS whether to save your syntax in the traditional code page form or Unicode from the syntax window. If saved as Unicode, it will be in utf-8 and will have a three-byte header that identifies it as Unicode. Regular Notepad understands this perfectly and interprets the text correctly, but Notepad+ might have problems. From what I see in the Notepad+ readme, it is very, very old, so I wouldn't hold out much hope. As for line endings, syntax files are saved with a cross-platform newline character starting with 16. Since Windows typically uses cr-lf, Mac uses cr, and Linux/Unix systems typically use lf, some software, including Notepad, may not understand the lf-only ending. Many other editors do. HTH, Jon Peck -----Original Message----- From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of Statmanz Sent: Tuesday, November 04, 2008 7:59 AM To: [hidden email] Subject: Re: [SPSSX-L] V16 syntax files in notepad Gene, I was able to work with Notepad+ and V16 syntax and also can with V17 but in V17 when I zip and compress the syntax it becomes corrupt so simply have to zip "as is" WMB Statistical Services ============ mailto: [hidden email] http:\\home.earthlink.net\~info.statman ============ On 11/4/2008 9:28:53 AM, Gene Maguin ([hidden email]) wrote: > Previously, syntax files displayed in Notepad in the same manner as they > do > in the spss syntax editor. But now they do not. I understand > it's a trivial > thing but notepad is useful for scanning through files without having to > start up spss itself and, I guess, some folks use notepad to edit syntax > files. It seems as though notepad doesn't > recognize or process the end of > line (EOL) or end of record (EOR) marker correctly anymore. That makes me > wonder if the EOL or EOR character has been changed--for some reason. > However, v16 syntax files display correctly on an editor like multiedit. > Why > the issue for one program but not another. > > So, > I'm curious (but with a little edge) as to why this is. Does anyone > know? I'm > also curious as to whether this is true for 17 as well. > > 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 ===================== 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 |
|
In reply to this post by Maguin, Eugene
Since this is something that I suspect many SPSS users liked and would use, wouldn't it make sense to put the capability back into SPSS instead of opening the slippery slope of making codebooks for users?
Melissa -----Original Message----- From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of Gene Maguin Sent: Monday, November 03, 2008 3:55 PM To: [hidden email] Subject: Re: [SPSSX-L] Is there an easier way? Jon, Thank you for your offer to make the codebook for me. To all who replied: thank you. It turns out that there is hard way to do it. I think I've done it now (but I've already thought that several times today). Gene Maguin ===================== Somebody has given me an dataset and I'd like to make a codebook for it. I had thought the easiest way to do this would be to do Display dictionary command. I don't know that this used to be true (perhaps it was) but that command now gives two tables, one with variable level info and another with value level info. Together, they're what I need. The key word is together. Putting them together, however, has been kicking me around my office today. Is there an easier way to make a code book, minimally defined as VarName, VarLabel, Value, ValLabel From a given dataset? I am not interested in Python or script procedures. PRIVILEGED AND CONFIDENTIAL INFORMATION This transmittal and any attachments may contain PRIVILEGED AND CONFIDENTIAL information and is intended only for the use of the addressee. If you are not the designated recipient, or an employee or agent authorized to deliver such transmittals to the designated recipient, you are hereby notified that any dissemination, copying or publication of this transmittal is strictly prohibited. If you have received this transmittal in error, please notify us immediately by replying to the sender and delete this copy from your system. You may also call us at (309) 827-6026 for assistance. ===================== 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 |
|
Well, we did. Version 17 has a nice new CODEBOOK command, and the CODEBOOK extension command is available for earlier versions.
Both of these commands integrate variable dictionary information with descriptive statistical output. The 17 version is in the base and requires no programmability materials. The older one, of course, requires the Python plug-in, but it doesn't require any knowledge of programmability, since it is an extension command. Regards, Jon Peck -----Original Message----- From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of Melissa Ives Sent: Tuesday, November 04, 2008 9:45 AM To: [hidden email] Subject: Re: [SPSSX-L] Is there an easier way? Since this is something that I suspect many SPSS users liked and would use, wouldn't it make sense to put the capability back into SPSS instead of opening the slippery slope of making codebooks for users? Melissa -----Original Message----- From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of Gene Maguin Sent: Monday, November 03, 2008 3:55 PM To: [hidden email] Subject: Re: [SPSSX-L] Is there an easier way? Jon, Thank you for your offer to make the codebook for me. To all who replied: thank you. It turns out that there is hard way to do it. I think I've done it now (but I've already thought that several times today). Gene Maguin ===================== Somebody has given me an dataset and I'd like to make a codebook for it. I had thought the easiest way to do this would be to do Display dictionary command. I don't know that this used to be true (perhaps it was) but that command now gives two tables, one with variable level info and another with value level info. Together, they're what I need. The key word is together. Putting them together, however, has been kicking me around my office today. Is there an easier way to make a code book, minimally defined as VarName, VarLabel, Value, ValLabel From a given dataset? I am not interested in Python or script procedures. PRIVILEGED AND CONFIDENTIAL INFORMATION This transmittal and any attachments may contain PRIVILEGED AND CONFIDENTIAL information and is intended only for the use of the addressee. If you are not the designated recipient, or an employee or agent authorized to deliver such transmittals to the designated recipient, you are hereby notified that any dissemination, copying or publication of this transmittal is strictly prohibited. If you have received this transmittal in error, please notify us immediately by replying to the sender and delete this copy from your system. You may also call us at (309) 827-6026 for assistance. ===================== 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 |
|
In reply to this post by Maguin, Eugene
When I do the Codebook command (syntax below) under V17 an error that
VARINFO is not a recognized subcommand? CODEBOOK age_gp [n] State [n] Country [n] /VARINFO POSITION LABEL VALUELABELS /OPTIONS VARORDER=VARLIST SORT=ASCENDING MAXCATS=200 /STATISTICS COUNT PERCENT MEAN STDDEV QUARTILES. W On 11/4/2008 12:08:57 PM, Peck, Jon ([hidden email]) wrote: > Well, we did. Version 17 has a nice new CODEBOOK command, and the > CODEBOOK extension command is available for earlier versions. > > Both of these commands integrate variable dictionary information with > descriptive statistical output. The 17 version is in the base and > requires no programmability materials. The older one, of course, requires > the Python plug-in, but it > doesn't require any knowledge of programmability, since it is an extension command. > > Regards, > Jon Peck > > -----Original Message----- > From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of Melissa Ives > Sent: Tuesday, November 04, 2008 9:45 AM > To: [hidden email] > Subject: Re: [SPSSX-L] Is there an easier way? > > Since this is something that I suspect many SPSS users liked and would use, wouldn't > it make sense to put the capability back into SPSS instead of opening the > slippery slope of making codebooks for users? > > Melissa > > -----Original Message----- > From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of > Gene Maguin > Sent: Monday, November 03, 2008 3:55 PM > To: [hidden email] > Subject: Re: [SPSSX-L] Is there an easier way? > > Jon, > > Thank ===================== 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
Will
Statistical Services ============ info.statman@earthlink.net http://home.earthlink.net/~z_statman/ ============ |
|
Do you have the older extension command installed under 17? Extension commands take priority over built-in ones, so you would need to remove codebook.xml from your version 17 extensions subdirectory or change the name field in that xml file. (There is no problem with having the extension defined for another installed SPSS version.)
HTH, Jon -----Original Message----- From: Statmanz [mailto:[hidden email]] Sent: Tuesday, November 04, 2008 10:49 AM To: Peck, Jon; [hidden email] Subject: Re: Re: Is there an easier way? When I do the Codebook command (syntax below) under V17 an error that VARINFO is not a recognized subcommand? CODEBOOK age_gp [n] State [n] Country [n] /VARINFO POSITION LABEL VALUELABELS /OPTIONS VARORDER=VARLIST SORT=ASCENDING MAXCATS=200 /STATISTICS COUNT PERCENT MEAN STDDEV QUARTILES. W On 11/4/2008 12:08:57 PM, Peck, Jon ([hidden email]) wrote: > Well, we did. Version 17 has a nice new CODEBOOK command, and the > CODEBOOK extension command is available for earlier versions. > > Both of these commands integrate variable dictionary information with > descriptive statistical output. The 17 version is in the base and > requires no programmability materials. The older one, of course, requires > the Python plug-in, but it > doesn't require any knowledge of programmability, since it is an extension command. > > Regards, > Jon Peck > > -----Original Message----- > From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of Melissa Ives > Sent: Tuesday, November 04, 2008 9:45 AM > To: [hidden email] > Subject: Re: [SPSSX-L] Is there an easier way? > > Since this is something that I suspect many SPSS users liked and would use, wouldn't > it make sense to put the capability back into SPSS instead of opening the > slippery slope of making codebooks for users? > > Melissa > > -----Original Message----- > From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of > Gene Maguin > Sent: Monday, November 03, 2008 3:55 PM > To: [hidden email] > Subject: Re: [SPSSX-L] Is there an easier way? > > Jon, > > Thank ====================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 Melissa Ives
Melissa,
A codebook procedure was added to version 17. To see what else is new in v17 please click on the What's New tab at http://www.spss.com/statistics/. Regards. Kyle Weeks, Ph.D. Director of Product Strategy, SPSS Statistics SPSS Inc. Phone: 1.312.651.3645 / Fax: 1.312.651.3690 [hidden email] www.spss.com SPSS Inc. helps organizations turn data into insight through predictive analytics. -----Original Message----- From: Melissa Ives [mailto:[hidden email]] Sent: Tuesday, November 04, 2008 10:45 AM To: [hidden email] Cc: Suggest Subject: RE: [SPSSX-L] Is there an easier way? Since this is something that I suspect many SPSS users liked and would use, wouldn't it make sense to put the capability back into SPSS instead of opening the slippery slope of making codebooks for users? Melissa -----Original Message----- From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of Gene Maguin Sent: Monday, November 03, 2008 3:55 PM To: [hidden email] Subject: Re: [SPSSX-L] Is there an easier way? Jon, Thank you for your offer to make the codebook for me. To all who replied: thank you. It turns out that there is hard way to do it. I think I've done it now (but I've already thought that several times today). Gene Maguin ===================== Somebody has given me an dataset and I'd like to make a codebook for it. I had thought the easiest way to do this would be to do Display dictionary command. I don't know that this used to be true (perhaps it was) but that command now gives two tables, one with variable level info and another with value level info. Together, they're what I need. The key word is together. Putting them together, however, has been kicking me around my office today. Is there an easier way to make a code book, minimally defined as VarName, VarLabel, Value, ValLabel From a given dataset? I am not interested in Python or script procedures. PRIVILEGED AND CONFIDENTIAL INFORMATION This transmittal and any attachments may contain PRIVILEGED AND CONFIDENTIAL information and is intended only for the use of the addressee. If you are not the designated recipient, or an employee or agent authorized to deliver such transmittals to the designated recipient, you are hereby notified that any dissemination, copying or publication of this transmittal is strictly prohibited. If you have received this transmittal in error, please notify us immediately by replying to the sender and delete this copy from your system. You may also call us at (309) 827-6026 for assistance. ===================== 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 Peck, Jon
I don't ever do much graphing so I'm really unfamiliar with graphing in 16
and, especially with chartbuilder. Plus, I confess to being lazy today. Our IT guy asked me to help with some data presentation. I've aggregated the data to months for 2007 and 2008 and now have in mind a graph showing 2007 as one line and 2008 as another line. I'd then like to put a best fit straight line through the 2007 points and a second best fit line through the 2008 points. I'd bet that all could be done through chartbuilder, which is my next rambling question. My data look like Year month AAA 2007 Jan 213 ... 2007 Dec 233 2008 Jan 224 ... 2008 Dec 241 After stumbling around for a while, I got a chart that plots the value of AAA by month by year. But it has some problems. I want x axis to be in file order because $casenum=1 is Jan, $casenum=2 is Feb, etc. How do I do that? Seems like that ought to be an ordinary option. Next, how do I put the regression lines on? I might not have looked well enough but there didn't seem to be anything about regression lines on the chart builder thing. How do I do that? Thanks, Gene Maguin But, it's not really what I want. First, my x-axis variable is month ===================== 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 |
|
The Chart Builder UI doesn't provide a quick way to do a regression line,
for that you have to modify the GPL. But first, you have a much bigger problem if your month variable is defined as a string. So your first problem is to get your X axis variable to be a number or date. You could even make your x axis use a variable computed from but you wouldn't get the month names there. Are you willing to do this chart using syntax in place of Chart Builder? -----Original Message----- From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of Gene Maguin Sent: Monday, November 10, 2008 2:53 PM To: [hidden email] Subject: Graphing and Chartbuilder question I don't ever do much graphing so I'm really unfamiliar with graphing in 16 and, especially with chartbuilder. Plus, I confess to being lazy today. Our IT guy asked me to help with some data presentation. I've aggregated the data to months for 2007 and 2008 and now have in mind a graph showing 2007 as one line and 2008 as another line. I'd then like to put a best fit straight line through the 2007 points and a second best fit line through the 2008 points. I'd bet that all could be done through chartbuilder, which is my next rambling question. My data look like Year month AAA 2007 Jan 213 ... 2007 Dec 233 2008 Jan 224 ... 2008 Dec 241 After stumbling around for a while, I got a chart that plots the value of AAA by month by year. But it has some problems. I want x axis to be in file order because $casenum=1 is Jan, $casenum=2 is Feb, etc. How do I do that? Seems like that ought to be an ordinary option. Next, how do I put the regression lines on? I might not have looked well enough but there didn't seem to be anything about regression lines on the chart builder thing. How do I do that? Thanks, Gene Maguin But, it's not really what I want. First, my x-axis variable is month ===================== 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 |
| Free forum by Nabble | Edit this page |
