When analyzing trended data, you may want to isolate and compare non-adjacent time periods, for example, current quarter vs. same quarter last year.
You can create an Ordinal variable from a Date/Time variable that can be used to compare two time periods of your choosing.
For example, you can reduce your crosstab from looking at all time periods:
To a reduced set of two time periods to compare against each other:
This article details how to create custom time periods to be compared.
- A data set loaded into Displayr with a Date/Time variable.
- Select the Date/Time variable in the Data Sets tree.
- Go to Anything > Variables > New > Ready-Made New Variables > Contrast Periods. This will create a new categorical variable just below the Date/Time variable.
- In the object inspector, set the Date aggregation to the duration you prefer (week, month, quarter, etc.).
- Select the periods that you would like to contrast in the Compare and Versus fields.
- Click Calculate.
This variable can now be used to show and test for changes/contrasts between the selected periods.
The date periods available in the Compare and Versus menus are generated at the time you first use this tool. They are evaluated relative to the dates in your data set, and they are extended for a period of three years to allow you to continue to use the same Contrasts as you continue to update your data set with new data.
The Contrasts variable contains two categories, but only one of them is shown. Date values which are not in the Compare or Versus periods are assigned a missing value. The resulting statistical tests are then equivalent to a comparison between Compare and Versus.