Data File Management and Descriptive Statistics with SPSS – Problem 5.1: Count Math Courses Taken

Sometimes you want to know how many items the participants have taken, bought, done, agreed with, and so forth. One time this happens is when the subject is asked to “check all that apply.” In Chapter 2, we could have counted how many aspects of the class assignments (reading, homework, and extra credit) the students checked by counting the number of items checked. In this problem, we will count the number of math courses coded as 1, which means “taken.”

How many math courses (algebra 1, algebra 2, geometry, trigonometry, and calculus) did each of the 75 participants take in high school? Label your new variable.

If the hsbdata file is not showing, click on the hsbdata bar at the bottom of your screen until you see your data showing. Now let’s count the number of math courses (mathcrs) that each of the 75 participants took in high school. First, remember to set your computer to obtain a listing of the syntax (see Appendix A, Print Syntax) if it is not already set to do so.

  • Select Transform   Count Values within Cases…. You will see a window like Fig. 5.1 below.
  • Now, type mathcrs in the Target Variable This is the program’s name for your new variable.
  • Next, type math courses taken in the Target Label
  • Then, while holding down the shift key, highlight algebra 1, algebra 2, geometry, trigonometry, and calculus and click on the arrow button to move them over to the Numeric Variables Your Count window should look like Fig. 5.1.

  • Click on Define Values.
  • Type 1 in the Value box and click on Add. This sets up the computer to count how many 1s (or courses taken) each participant had. The window will now look like Fig. 5.2.
  • Now click on Continue to return to the dialog box in Fig. 5.1.
  • Click on OK. The first 10 numbers of your new variable, under mathcrs, should look like Fig. 5.3. It is the last variable, way over to the right side of your Data View, and the last variable way on the bottom of your Variable View.

Your output should look like the syntax in Output 5.1.

If you want to delete the decimal places for your new data:

  • Go to the Variable View.
  • Scroll down to the last (new) variable, mathcrs.
  • Click on the cell under
  • Highlight the 2 in the Decimals box and enter 0, or use the arrow buttons to change the number to zero.

Source: Morgan George A, Leech Nancy L., Gloeckner Gene W., Barrett Karen C.

(2012), IBM SPSS for Introductory Statistics: Use and Interpretation, Routledge; 5th edition; download Datasets and Materials.

Leave a Reply

Your email address will not be published. Required fields are marked *