When you have a quantity question in your survey, you sometimes want to split the results into bands for analysis (for example, when you wish to split ages or salaries into ranges).
There is a quick way of doing this using numeric variables.
Numeric variables are a type of derived variable, i.e, they contain information that is derived from people’s responses. This worksheet will use the data in the snCrocodile survey supplied with Snap to show you how to band the amount spent.
Quantity data provides a continuous set of values. Because of this it is difficult to find out how values are distributed, as every response could be different. If you want to see what ranges responses fall into, you have to group the responses together. You can choose how to group your responses, though it is best to group them into equal size bands to see how the responses are distributed. You need to choose how wide the bands are to make sure that you don’t miss any important spikes or dips (which might average out over a wide band).
To do this, you need to find out what the minimum and maximum value responses are, and use this information to divide the range into equal bands. Snap allows you to display the minimum and maximum value in a table of descriptive statistics.
Once you have decided on your bands, you must sort the responses into those ranges, so you can use them in charts and tables. This is done by creating a variable derived from the original response.
There are several types of derived variables in Snap. These are known as derived, numeric, pre-coded and alphanumeric variables.
- Derived is a general type that can be used on any type or number of variables.
- Numeric, pre-coded and alphanumeric variables are generated from a single variable. You set this variable as the data source, and then describe how it is converted into the new variable.
Derived variables have much more flexibility, but if you are converting a single variable into a set of ranges or values, it can be quicker to use one of the other types.
When you are splitting a quantity into bands, it is good practice to choose bands of equal size. Start by finding what the maximum and minimum values are.
- Click to create a table.
- Set the Analysis value to Q5 (the “Amount spent” question).
- Select Statistics table from the drop down list for the Break.
- Click the Descriptive Statistics tab to select what information will appear in your table.
- Use the [<] button to remove all entries from the Used column apart from the Minimum, Maximum and Range statistics.
- Click [OK] to create your table.
This tells you how the top of bottom limits of your bands. For a coarse grain banding, you could split the data into bands of 1 – 7.99 8 – 14.99 and 15 – 22.
- Open the snCrocodile survey.
- Click on the toolbar to open the variables window (or select View | Variables).
- Find Q5 in the list of variables to check that it is the one you want. This is the variable where people’s total spend is recorded.
- Click on the variables window toolbar to create a new variable.
- Set the Type to Numeric.
- Add a label (e.g. Banded spends) to describe the variable in any analyses.
- Set the Response to Single.
- Click the button to display the variable definition.
- Type Q5 in the Source field. This means that the data will be derived from the response in Q5.
- Click in the empty Code Label field.
- Enter your first range. Type Low spend (£1 – 7.99) as the label. Press [Tab] to move to the Values field and enter 1 to 7.99.
- Press the [Tab] key to enter a new code and give it a label of Medium spend (£8 – 14.99) and give a value of 8 to 14.99.
- Repeat to create a code with label High spend (£15 – 22) and a value of 15 to 22.
- Click to save your new variable.
- Click on the toolbar to create a chart.
- Set the style to Bar 2D Labelled percents. Set the analysis value to the name of your new variable (V2C) and check the Transpose box.
- Click [OK] to display your chart.
You can see that nearly all the responses are in the lowest band. For further detail, you will need to redefine your variable or create a new variable with narrower bands.
- Open the new variable and select the first code (Low spend).
- Change the values from 1 to 7.99 to 1 to 3.99, and change the label to match.
- Click to duplicate the code.
- Change the new code values to 4 to 6.99 and edit the label.
- Duplicate the code again and give it values of 7 to 9.99.
- Change the Medium spend code values to 10 to 12.99.
- Duplicate the code and give the new code values of 13 to 15.99.
- Change the High spend code values to 16 to 18.99.
- Duplicate the code and give it values of 19 to 22.
- Click to save your changes.
- If your chart is still open it will now have Out of Date on the title bar.
- Press to update the chart.
The previous graph showed that the most people spent less than seven pounds in the shop, which the other bands being roughly equal.
You could further analyse the low end spending in a separate graph.
- Select your new variable in the variables window and press to duplicate the variable.
- Change the label to something like Low end banded spends – to make it clear that this is only a subset of the data.
- Change the first code label to 1 – 1.99.
- Change its value to <2. All values that are less than 2 will now be stored in this variable.
- Change the second code label to 2 – 2.99 and change its value to <3. Since the values lower than two have already been placed in the first code, values from 2 to 2.99 will now be in this variable.
- Continue setting up the codes until you get to 6 – 6.99 and <7.
- Click to save your changes.
- Create a bar chart displaying your new variable.
You can see from this that the most popular lower end spend is between three and four pounds.
This worksheet has shown you how to split the responses in a quantity variable into bands for analysis. It has explained how to see what the maximum and minimum values for the variable are, and how to create a numeric variable to store the banded information.
It also shows you another way of setting up values for banded variables using the < symbol rather than a range.
For more information about analysing quantity variables, see the section Quantity responses.
There is a worksheet available on analysing literal variables using a derived variable.
If there is a topic you would like a worksheet on, email to firstname.lastname@example.org