Hi,
Is it possible to restructure or merge rows in a datafile where there are several observations with same date. Date format is "mmm yy." The reason for wanting to merge the observations is to convert the datafile to a timeseries. Is there a simpler way to accomplish this? Regards Eivinn |
Hi Eivinn,
To restructure - use the Restructure Wizard, Data -> Restructure... To merge - use Aggregate, Data -> Aggregate..., then select the aggregating functions (mean, sum,...), break variable (=time) and Save = Write a new datafile... HTH Jan -----Original Message----- From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of Eivinn Fjellhammer Sent: Tuesday, December 19, 2006 9:05 AM To: [hidden email] Subject: Is it possible to merge rows with same date? Hi, Is it possible to restructure or merge rows in a datafile where there are several observations with same date. Date format is "mmm yy." The reason for wanting to merge the observations is to convert the datafile to a timeseries. Is there a simpler way to accomplish this? Regards Eivinn |
Hi,
I've been using Aggregate, with the date variable as break variable. Still, it doesn't merge the rows. The program runs the function I indicate in each cell. The rows, however, stay the same. Eivinn Spousta Jan <[hidden email]> Sendt av: "SPSSX(r) Discussion" <[hidden email]> 19.12.2006 09:17 Vennligst send svar til Spousta Jan <[hidden email]> Til [hidden email] cc Emne Re: Is it possible to merge rows with same date? Hi Eivinn, To restructure - use the Restructure Wizard, Data -> Restructure... To merge - use Aggregate, Data -> Aggregate..., then select the aggregating functions (mean, sum,...), break variable (=time) and Save = Write a new datafile... HTH Jan -----Original Message----- From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of Eivinn Fjellhammer Sent: Tuesday, December 19, 2006 9:05 AM To: [hidden email] Subject: Is it possible to merge rows with same date? Hi, Is it possible to restructure or merge rows in a datafile where there are several observations with same date. Date format is "mmm yy." The reason for wanting to merge the observations is to convert the datafile to a timeseries. Is there a simpler way to accomplish this? Regards Eivinn |
The aggregated file should be saved on the disk. You should open it and
work with it. Do not forget to set Save = Write a new datafile... and choose an appropriate name for the aggregated file. Another possibility is that the dates in one month are in fact not equal - they may be formated to show "Dec 06" but under this format, different days of the monts are hidden. In this case you need to round the dates and then aggregate. Try to change the format in the Variable View to dd-mmm-yy and see whether the dates in one month are really equal. Jan -----Original Message----- From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of Eivinn Fjellhammer Sent: Tuesday, December 19, 2006 9:37 AM To: [hidden email] Subject: Ad: Re: Is it possible to merge rows with same date? Hi, I've been using Aggregate, with the date variable as break variable. Still, it doesn't merge the rows. The program runs the function I indicate in each cell. The rows, however, stay the same. Eivinn Spousta Jan <[hidden email]> Sendt av: "SPSSX(r) Discussion" <[hidden email]> 19.12.2006 09:17 Vennligst send svar til Spousta Jan <[hidden email]> Til [hidden email] cc Emne Re: Is it possible to merge rows with same date? Hi Eivinn, To restructure - use the Restructure Wizard, Data -> Restructure... To merge - use Aggregate, Data -> Aggregate..., then select the aggregating functions (mean, sum,...), break variable (=time) and Save = Write a new datafile... HTH Jan -----Original Message----- From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of Eivinn Fjellhammer Sent: Tuesday, December 19, 2006 9:05 AM To: [hidden email] Subject: Is it possible to merge rows with same date? Hi, Is it possible to restructure or merge rows in a datafile where there are several observations with same date. Date format is "mmm yy." The reason for wanting to merge the observations is to convert the datafile to a timeseries. Is there a simpler way to accomplish this? Regards Eivinn |
Thanks,
This solved the problem. The issue was that I had defined the date variable, also the break variable, as a scale and as a date. I redefined the variable as a nominal text string, and ran the aggregate command again. I then defined the date variable in the new data file back to the "date" format. This resulted in the dataset I wanted. Thank you again for valuable input. Best regards Eivinn Spousta Jan <[hidden email]> Sendt av: "SPSSX(r) Discussion" <[hidden email]> 19.12.2006 12:47 Vennligst send svar til Spousta Jan <[hidden email]> Til [hidden email] cc Emne Re: Ad: Re: Is it possible to merge rows with same date? The aggregated file should be saved on the disk. You should open it and work with it. Do not forget to set Save = Write a new datafile... and choose an appropriate name for the aggregated file. Another possibility is that the dates in one month are in fact not equal - they may be formated to show "Dec 06" but under this format, different days of the monts are hidden. In this case you need to round the dates and then aggregate. Try to change the format in the Variable View to dd-mmm-yy and see whether the dates in one month are really equal. Jan -----Original Message----- From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of Eivinn Fjellhammer Sent: Tuesday, December 19, 2006 9:37 AM To: [hidden email] Subject: Ad: Re: Is it possible to merge rows with same date? Hi, I've been using Aggregate, with the date variable as break variable. Still, it doesn't merge the rows. The program runs the function I indicate in each cell. The rows, however, stay the same. Eivinn Spousta Jan <[hidden email]> Sendt av: "SPSSX(r) Discussion" <[hidden email]> 19.12.2006 09:17 Vennligst send svar til Spousta Jan <[hidden email]> Til [hidden email] cc Emne Re: Is it possible to merge rows with same date? Hi Eivinn, To restructure - use the Restructure Wizard, Data -> Restructure... To merge - use Aggregate, Data -> Aggregate..., then select the aggregating functions (mean, sum,...), break variable (=time) and Save = Write a new datafile... HTH Jan -----Original Message----- From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of Eivinn Fjellhammer Sent: Tuesday, December 19, 2006 9:05 AM To: [hidden email] Subject: Is it possible to merge rows with same date? Hi, Is it possible to restructure or merge rows in a datafile where there are several observations with same date. Date format is "mmm yy." The reason for wanting to merge the observations is to convert the datafile to a timeseries. Is there a simpler way to accomplish this? Regards Eivinn |
In reply to this post by Eivinn Fjellhammer
I concur with Jan about using AGGREGATE.
Note that you should sort on ID and Date first. Also, be sure that you have not simply reformatted a date variable as MMMYY. Dates 1/1/2006 and 1/15/2006 will both display as JAN 06 but the underlying value is different so the AGGREGATE will not yield the expected results. In this case you'll need to recalculate the date to keep only month and year. Dennis Deck, PhD RMC Research Corporation [hidden email] -----Original Message----- From: Eivinn Fjellhammer [mailto:[hidden email]] Sent: Tuesday, December 19, 2006 12:05 AM Subject: Is it possible to merge rows with same date? Hi, Is it possible to restructure or merge rows in a datafile where there are several observations with same date. Date format is "mmm yy." The reason for wanting to merge the observations is to convert the datafile to a timeseries. Is there a simpler way to accomplish this? Regards Eivinn |
Free forum by Nabble | Edit this page |