A Tech Blog by David Kandie

Thursday, July 26, 2012

How to Analyze Multiple Responses in SPSS

How to analyze multiple responses in SPSS
Generating New Variables in SPSS: The Multiple Response Command
The table below shows part of a Health Issues survey questionnaire.

Question:
Thinking about health related matters, did any of the following happen to you in the last 1 Month?


Response
Response
Yes
No
I was ill enough to go to the doctor


I sought counseling for mental problems


I had problems with infertility


I suffered from a drinking problem


I used illegal drugs


My child had to go to hospital


My partner had to go to hospital


A close friend died


My child suffered from drug or alcohol problems



The answers to such a set of questions are regarded as multiple responses, since the answer to each does not preclude an answer for the others; the responses are not mutually exclusive.
The answer to each of these questions is regarded, for the purpose of SPSS coding and data entry, as. a separate variable. That is, a column is set up for each of the items to which a respondent can answer Yes or No. In this instance, therefore, there are 9 columns of data; one containing either a 1 (= Yes) or 2 (= No) for each case according to whether they were ill enough to go to the doctor, another column containing 1 or 2 for each case indicating whether they had sought counseling for mental problems, and so on.

To code this in SPSS we use the code hlth1, hlth2, hlth3…hlth9
After coding and typing the respective labels, SPSS will look like the figure below:

Figure 1 - Variable View
The data view will look like the figure 2 below after data entry

Figure 2 - data view for multiple responses
With the data entered in this way, if we wanted to see the number of Yes responses for each of these variables we would have to generate 9 separate frequency tables and note the number of Yes responses in each.

An alternative, which also allows us to do further analysis, is to use the Multiple Response command. The Multiple Response command allows us to analyze a number of separate variables at the same time, and is best used in situations where the responses to a number of separate variables that have a similar coding scheme all ‘point to’ a single underlying variable.

In this example, we can consider each of the items in the question as all pointing to the state of a respondent’s health. They are particular operationalizations, each of which captures just one dimension of this complex variable. It is therefore interesting to summarize the responses to these items at once, and to be able to use the pattern of responses across these items in further analysis with other variables, which is exactly what the Multiple Response command allows us to do.
To use the Multiple Response command we initially have to set up a Multiple Response
Set. This procedure instructs SPSS to group together the responses across a range of variables.
Before doing this it is important to have noted the coding scheme for the items that will make up the Multiple Response Set. In this instance, the coding is 1  - 9 for the various health conditions. We note this because we need to tell SPSS which value (or range of values) is of interest to us. Here we are interested in all the Yes responses to each item.



Figure 3 - Define the Multiple Response variable sets

Transfer the Multiple variables to the right
Figure 4 - defining the variable categories
Since we have 2 responses (Yes, 1 and No, 2) we select categories 1 to 2.
Now that we have defined the multiple responses set we can analyze it. The ‘new’ variable that we have just created and called hlth_con does not appear on the Data Editor window with the existing variables, but is stored in SPSS’s memory, and is accessed only through the
Analyze/Multiple Response/Frequencies command. It won’t appear in the normal dialog boxes we are familiar with which present the variables in the data file in a source variable list.
It is also not saved with the data file and will disappear when the file is closed, so it is a good idea to perform all the analysis you plan to undertake using the multiple response set before finishing your current SPSS session.
The simplest analysis we can undertake on a multiple response set is to run a frequency  (Figure 5) on the new variable (Though you can also perform crosstabs

To analyze multiple frequencies

Figure 5 - Analyze Frequencies
The SPSS multiple frequencies command. Then Press OK




Tuesday, July 10, 2012

How to perform a multi-column search in Excel (Using Conditional Formatting)

Adapted from TechRepublic (www.techrepublic.com)
Excel offers numerous ways to search, sort, and filter data, and they’re easy to combine and automate. For instance, you can create a user-friendly multi-column search solution by combining validation lists and conditional formatting. It’s simple to implement and easy to enhance as you grow.
First, you’ll create a unique list of values based on the data you want to search. Next, you’ll use the data validation feature to create drop-down lists based on those unique lists. Once all the pieces are in place, you’ll add a conditional formatting rule that pulls them together.
Because this technique derives lists using the data validation feature, save this technique for static (or mostly static) data. You’ll have to update the lists and conditional formatting range if you change the data range. Of course, you could create dynamic lists and a dynamic input range to handle frequent updates — but that’s more work.

Note you can download the working file here  

Download the full post here in PDF

---
About the author
David Kandie is the founder and lead consultant at OpenCastLabs Consulting based in Kenya and Rwanda

Saturday, July 7, 2012

How to Build Dynamic Charts in Excel using OFFSET Function

Applies to Excel 2007 and 2010
Report writers having to edit the Source Data of their graphs every time they want to update their graphs face quite a daunting task especially if the the columns to be updated are many. More important is building  a chart that is automatically updated as you add new information to an existing chart range in Microsoft Excel.

This can be done by using defined names that dynamically change as you add or remove data with the OFFSET Function.

Suppose we use TB Cases (Type in Column A header "Month" with Jan - April) and  Column B "TB Cases" with 9, 11, 6, 25

Download the Workbook

Step I:  Create an Offset function that will dynamically update values in both Column A and B.
  1. On the Formulas tab, click Define Name in the Defined Names group (Press F3 and click new) 
  2. In the Name box, type Date.
  3. In the Refers to box, type =OFFSET($A$2,0,0,COUNTA($A:$A)-1), and then click OK
  4. On the Formulas tab, click Define Name in the Defined Names group. (Press CTRL+F3 and click new) 
  5. In the Name box, type TB_Cases (Use an underscore - no spaces or special characters) 
  6. In the Refers to box, type =OFFSET($B$2,0,0,COUNTA($B:$B)-1), and then click OK
  7. Clear cell B2, and then type the following formula: =RAND()*0+9
This formula uses the volatile RAND function. The formula automatically updates the OFFSET formula that is used in the defined name "TB_Cases" when you enter new data into column B. The value 9, which is used in this formula, is the original value of cell B2.

Step II: Insert Graph 
  1. On the Insert tab, click a chart, and then click a chart type.
  2. Click the Design tab, click the Select Data in the Data group
  3. Under Legend Entries (Series), click Edit.
  4. In the Series values box, type =Sheet1!TB_Cases, and then click OK.
  5. Under Horizontal (Category) Axis Labels, click Edit.
  6. In the Axis label range box, type =Sheet1!Date, and then click OK.
Step III - Test the graph

 Enter in Cell A6 the date "5/1/2012" and 30 on  Cell B6 the press enter - the graph dynamically add the Month and the data. If you delete the data, the graph shrinks and vice-verse

 ---------------------------------------------------------------------------------------------------------

Training your staff today email us info(at)opencastcast-labs.com go to www.opencast-labs.com.

Download Free books here

--------------------------------

David Kandie is founder and managing partner at OpenCastLabs. He provides training and consulting services to emerging and midsize businesses, helping them achieve a higher level of success through custom report development and productivity training.