plzhelp
plzhelp

Reputation: 205

Binning time values in SPSS modeler

I have a Time (24 hours formate) column in my dataset and I would like to use SPSS Modeler to bin the timings into the respective parts of the day.

For example, 0500-0900 = early morning ; 1000-1200 = late morning ; 1300-1500 = afternoon

May I know how do I go about doing that? Here is how my Time column looks like -

Time data column

Here is how to read the data - e.g. 824 = 0824AM ; 46 = 0046AM

I've actually tried to use the Binning node by adjusting the bin-width in SPSS modeler and here's the result:

SPSS modeler result

It's weird because I do not have any negative data in my dataset but the starting number of bin 1 is a negative amount as shown in the photo.

Upvotes: 0

Views: 471

Answers (2)

Julian
Julian

Reputation: 152

You can easily export the bins (Generate a derive node from that windows on the image) and edit the boundaries in accordance to your needs. Or try some other binning method that would fit the results better to what you expect as an output.

Upvotes: 0

Érica Wong
Érica Wong

Reputation: 119

The images that you added are blocked to me, but did you here's an idea of solution:

  • Create a Derive node with a query similar to this (new categorical variable): if (TIME>= 500 or TIME <=900) then 'early morning' elseif (TIME>= 1000 or TIME <=1200) then 'late morning' else 'afternoon' endif

Hope to have been helpful.

Upvotes: 0

Related Questions