Methods of Communication Research and Statistics Online Workbook
|
SPSS exercise 1.5
The MediaUse.sav database considers, among other things, the number of hours and minutes spent watching television on weekdays and weekend days. In other words, the time a person spends watching television is measured by two variables: v5hour (number of hours watching television on weekdays) and v5min (number of minutes watching television on weekdays). The same applies to v6hour and v6min: the amount of time spent watching television on a weekend day.
a. Suppose you want to find out how much time someone spends watching television on a weekend day. Could you simply add up the variables v6hour and v6min?
b. Therefore, we cannot simply add up the variables. Nevertheless, we want to introduce one new variable that measures the time someone spends watching television on a weekend day. We do that either by converting minutes into hours, or hours into minutes, and then adding them up. Introduce a new variable that adds up the number of hours and number of minutes someone spends watching television on a weekend day. The new variable should measure the number of minutes that someone spends watching television on a weekend day. Give the new variable the variable name 'v6tot' and the variable label 'total number of minutes spent watching television on a weekend day'. Compare your syntax to the correct answer.
c. Generate a frequency table of the new variable 'v6tot'. What is the minimum number of minutes spent watching television on a weekend day?
d. What is the maximum number of minutes spent watching television at weekends?
Hints
1 Creating a new variable based on an existing one
When you want to convert two or more variables into one variable, use the Compute function in SPSS. Compute is SPSS's 'calculator'; it can be used to make calculations within a variable. This means, for example, that we can calculate the variable 'year of birth' into the new variable 'age', or the variable 'number of hours watching TV' into 'number of minutes watching TV' or 'number of seconds watching TV'. Compute can only be used when the level of measurement of the variable is at least ordinal.
In the Transform menu, click Compute. This will open a screen: 'Compute variable'. In the 'Target variable' field, enter the name of the new variable you want to create. By clicking on the 'Type & labels' button, you can assign labels. Make a selection from the list of variables and click on the arrow. The 'Numeric expression' field now contains the selected variable. You now need to define the formula for calculating the values of the variable. When you have entered this formula into the field, click OK. A new variable will now be created.
2 Creating a new variable based on multiple existing variables
When you want to convert two or more variables into one variable, use the Compute function in SPSS. Compute is SPSS's 'calculator'; it can be used to add, subtract and multiply variables, etc.
Compute can only be used when the level of measurement of the variable is at least ordinal.
In the Transform menu, click Compute. This will open a screen: 'Compute variable'. In the 'Target variable' field, enter the name of the new variable that you want to create. You now need to define the formula for calculating the values of the new variable. The 'numeric expression' field now contains the formula. You can do this by typing or using the mouse to select the variables and symbols. When you have finished, click OK.
3 How do I generate a frequency table?
You generate a frequency table by selecting in the menu Analyse for the option Descriptive Statistics -> Frequencies. This then opens the following dialogue screen. You can move the variables for which you would like a frequency distribution from the left to the right column by selecting the variable (click on it with the mouse) and clicking the arrow between the columns. You can also move the variables from the right to the left column. Again, select the variable and click on the arrow. The arrow now points towards the left-hand column. If you want to move every variable from the left to the right column in one go, select all the variables (hold down the Shift button and move the cursor downwards). Conversely, you can move all the variables from the right to the left column by pressing Re-set.
|