|
I am a new user of SPSS and have my data in Excel. I want to analyse survival analysis from this file in SPSS. When I open the data file, the date in SPSS is different by which I can not calculate time. if any body can help me how I can change the date ? or how to open the file in which I can work and compute the time (year, month week and days)
From Homnath Nepal --------------------------------- Need a vacation? Get great deals to amazing places on Yahoo! Travel. |
|
Dr. Poudel,
What format is the date field in your EXCEL file? Are the months, days and years in separate columns? If they're in the same column what format are they in (mmddyyyy or mmddyy or ddmmyyy, etc)? Either way, the dates can be reformatted easily in either Excel or SPSS. If you post additional info about the fields someone here might be able to help. - Shahrukh Hashmi > -----Original Message----- > From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of > Dr. Hom Nath Poudel > Sent: Tuesday, July 10, 2007 8:41 AM > To: [hidden email] > Subject: please help > > I am a new user of SPSS and have my data in Excel. I want to analyse > survival analysis from this file in SPSS. When I open the data file, the > date in SPSS is different by which I can not calculate time. if any body > can help me how I can change the date ? or how to open the file in which I > can work and compute the time (year, month week and days) > > From > > Homnath > Nepal > > > --------------------------------- > Need a vacation? Get great deals to amazing places on Yahoo! Travel. |
|
Dear Mr. Hashmi,
The day, month and year were in the same column in ddmmyy format. if it is possible I am waiting your answer and suggestion regards homnath "Hashmi, Syed S" <[hidden email]> wrote: Dr. Poudel, What format is the date field in your EXCEL file? Are the months, days and years in separate columns? If they're in the same column what format are they in (mmddyyyy or mmddyy or ddmmyyy, etc)? Either way, the dates can be reformatted easily in either Excel or SPSS. If you post additional info about the fields someone here might be able to help. - Shahrukh Hashmi > -----Original Message----- > From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of > Dr. Hom Nath Poudel > Sent: Tuesday, July 10, 2007 8:41 AM > To: [hidden email] > Subject: please help > > I am a new user of SPSS and have my data in Excel. I want to analyse > survival analysis from this file in SPSS. When I open the data file, the > date in SPSS is different by which I can not calculate time. if any body > can help me how I can change the date ? or how to open the file in which I > can work and compute the time (year, month week and days) > > From > > Homnath > Nepal > > > --------------------------------- > Need a vacation? Get great deals to amazing places on Yahoo! Travel. --------------------------------- The fish are biting. Get more visitors on your site using Yahoo! Search Marketing. |
|
Dr. Poudel,
If you want to change the dates in EXCEL, then you can use the following code to convert the old text (string) field to a date field: =CONCATENATE(LEFT(A2,2),"/",MID(A2,3,2),"/",RIGHT(A2,2)) , where A2 is the cell with your old date field. This will result in a new value in the dd/mm/yy format. You can then change the column format to DATE. If you'd rather not have the date as dd/mm/yy, then you can modify the syntax above to reflect that. If you'd like to do this in SPSS, then you can use the Date and Time Wizard that comes with SPSS. You can access it through the TRANSFORM --> DATE AND TIME WIZARD. I know it's there in v15.0, but was probably there for the older ones too. It's quite easy to use and you can create new date fields from old text fields in any format. If you'd rather use code instead of the drop down menu, then the code in SPSS would be: COMPUTE newdate = date.dmy(number(substr(ltrim(olddate),1,2),f2.0), number(substr(ltrim(olddate),3,2),f2.0), number(substr(ltrim(olddate),5) ,f2.0)). VARIABLE LABEL newdate. VARIABLE LEVEL newdate (SCALE). FORMATS newdate (EDATE10). VARIABLE WIDTH newdate(10). EXECUTE. The above code creates a new variable called "newdate" from the old variable "olddate", and does pretty much what the EXCEL code did. HTH. Shahrukh Hashmi ________________________________ From: Dr. Hom Nath Poudel [mailto:[hidden email]] Sent: Tuesday, July 10, 2007 12:07 PM To: Hashmi, Syed S; [hidden email] Subject: Re: please help Dear Mr. Hashmi, The day, month and year were in the same column in ddmmyy format. if it is possible I am waiting your answer and suggestion regards homnath |
| Free forum by Nabble | Edit this page |
