|
Hi all:
I have a time variable in an Excel file that is already in military time (e.g., 13:20). However, when I simply read this file into SPSS I get some very large numbers (in the 900,000s). I simply want to the military conversion to carry over to SPSS. Any help would be greatly appreciated. Scott ===================== 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 |
|
Scott,
SPSS stores dates and times as seconds. You need to format the variable to be a time variable. This syntax will give you a time variable formatted as HH:MM Formats timevarname (TIME5). Melissa -----Original Message----- From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of Scott Roesch Sent: Tuesday, September 29, 2009 6:35 PM To: [hidden email] Subject: [SPSSX-L] new 24 hour time issue Hi all: I have a time variable in an Excel file that is already in military time (e.g., 13:20). However, when I simply read this file into SPSS I get some very large numbers (in the 900,000s). I simply want to the military conversion to carry over to SPSS. Any help would be greatly appreciated. Scott ===================== 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 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 Scott Roesch
At 07:35 PM 9/29/2009, Scott Roesch wrote:
>I have a time variable in an Excel file that is already in military >time (e.g., 13:20). However, when I simply read this file into SPSS >I get some very large numbers (in the 900,000s). I simply want to >the military conversion to carry over to SPSS. Any help would be >greatly appreciated. First, Excel date and time columns usually carry over to SPSS as date and time variables. Check whether you have a character value or some such near the beginning of the column. (In Excel, it may look exactly like 'hh:mm', but it will import into SPSS as a system-missing value.) If that is so, and you fix it, the import should work properly. Second, what you're seeing is odd. We've been over Excel dates on this list a number of times and I won't go into it in detail. Briefly, Excel dates are the number of days since the beginning of the 20th century; dates near the present have numerical values around 30,000. From Excel help: >Excel stores times as decimal fractions because time is considered a >portion of a day. That is, a time value is a fraction from 0-1, representing the portion of a day. A date-time value, of course, has an integer part as described, plus a fractional part. So I don't see how to get values near 900,000 in any Excel representation. Anybody else know about this? In the meantime, compare the values in SPSS with the times you see in Excel. You may, at least, be able to find out whether your values are in days, seconds, or what; and, counted from what starting point. If you find that out, you should be able to convert to an SPSS time value. -Best of luck, Richard Ristow ===================== 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
If the values are in the 900K range, that may not yield the desired result, unless the values are elapsed times, which can of course exceed a single day. There are only 86,400 seconds in a single day.
Values in the 900K range are also not likely to be SPSS datetime values, unless they are datetimes in the year 1582. And I don't think they are Excel datetime values, unless they represent times in the distant future, since Excel datetimes are stored internally as a number of days (with times represented as fractions) since 1900 (or something like that). -----Original Message----- From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of Melissa Ives Sent: Wednesday, September 30, 2009 8:41 AM To: [hidden email] Subject: Re: new 24 hour time issue Scott, SPSS stores dates and times as seconds. You need to format the variable to be a time variable. This syntax will give you a time variable formatted as HH:MM Formats timevarname (TIME5). Melissa -----Original Message----- From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of Scott Roesch Sent: Tuesday, September 29, 2009 6:35 PM To: [hidden email] Subject: [SPSSX-L] new 24 hour time issue Hi all: I have a time variable in an Excel file that is already in military time (e.g., 13:20). However, when I simply read this file into SPSS I get some very large numbers (in the 900,000s). I simply want to the military conversion to carry over to SPSS. Any help would be greatly appreciated. Scott ===================== 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 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 |
| Free forum by Nabble | Edit this page |
