0:00:00.000,0:00:03.060 >> So here we are in SPSS. 0:00:03.060,0:00:04.900 I have created a junk data 0:00:04.900,0:00:07.220 set just to help[br]illustrate how we can 0:00:07.220,0:00:08.840 compute variables[br]or compute 0:00:08.840,0:00:09.980 new variables using 0:00:09.980,0:00:12.010 the values from[br]existing ones. 0:00:12.010,0:00:14.140 This is a pretty[br]straightforward process. 0:00:14.140,0:00:15.280 It looks a little bit 0:00:15.280,0:00:16.680 different than things[br]that we've done 0:00:16.680,0:00:18.580 before or other[br]ways that we're 0:00:18.580,0:00:20.640 going to be using[br]SPSS in this course. 0:00:20.640,0:00:22.440 So it might look a[br]little bit different, 0:00:22.440,0:00:23.980 but it is pretty[br]straightforward and 0:00:23.980,0:00:26.375 pretty easy once you[br]know how to do this. 0:00:26.375,0:00:27.740 So the first[br]thing that we'll 0:00:27.740,0:00:29.345 do is go to Transform, 0:00:29.345,0:00:30.680 and then the[br]first option we 0:00:30.680,0:00:32.120 have there is[br]compute variable. 0:00:32.120,0:00:34.440 So click on that. We get 0:00:34.440,0:00:36.165 this new window[br]that pops up. 0:00:36.165,0:00:37.800 The first thing[br]that we really want 0:00:37.800,0:00:39.340 to look at is in[br]the top left, 0:00:39.340,0:00:42.580 and that's this target[br]variable window. 0:00:42.580,0:00:44.130 Basically what[br]the computer 0:00:44.130,0:00:45.610 is asking you is to create 0:00:45.610,0:00:47.630 a name for the[br]new variable 0:00:47.630,0:00:49.070 that you're going[br]to be computing. 0:00:49.070,0:00:50.860 This name needs[br]to be unique, 0:00:50.860,0:00:53.170 it's one that can't[br]have spaces in it, 0:00:53.170,0:00:55.315 and it should avoid[br]special characters. 0:00:55.315,0:00:56.710 But, in this case, 0:00:56.710,0:00:58.630 what I like to[br]do is include 0:00:58.630,0:01:01.330 some piece of[br]information in there 0:01:01.330,0:01:03.550 in the naming[br]convention I use that 0:01:03.550,0:01:04.810 helps me know what this is 0:01:04.810,0:01:06.250 just by looking at it. 0:01:06.250,0:01:07.890 So what we're going[br]to be doing is 0:01:07.890,0:01:09.650 we're going to be[br]summing items 1, 0:01:09.650,0:01:10.970 2, 3, 4, 5, 0:01:10.970,0:01:12.740 and 6 together, adding[br]those together. 0:01:12.740,0:01:14.330 So an easy way[br]to do that is 0:01:14.330,0:01:17.480 just to put sumofitems. 0:01:17.480,0:01:20.040 That way, when I look at 0:01:20.040,0:01:21.850 this new variable[br]once it's generated, 0:01:21.850,0:01:23.350 I know that that's[br]the variable 0:01:23.350,0:01:24.930 that I really want[br]to be working 0:01:24.930,0:01:26.720 with or running[br]my tests on 0:01:26.720,0:01:28.030 because that contains 0:01:28.030,0:01:29.865 the information from[br]the other ones. 0:01:29.865,0:01:32.970 You can click on[br]Type & Label. 0:01:32.970,0:01:36.390 The label is the more[br]drawn-out explanation. 0:01:36.390,0:01:37.870 That's one that[br]you can include 0:01:37.870,0:01:39.390 additional characters or 0:01:39.390,0:01:41.070 spaces and special[br]characters. 0:01:41.070,0:01:43.150 In our case, I'm[br]going to put this is 0:01:43.150,0:01:48.975 the sum of items[br]1 through 6. 0:01:48.975,0:01:50.790 And that way I know that 0:01:50.790,0:01:52.550 that is going to give me 0:01:52.550,0:01:55.150 a more drawn-out[br]explanation 0:01:55.150,0:01:57.010 of what this[br]variable includes. 0:01:57.010,0:01:59.325 We know this is[br]going to be numeric. 0:01:59.325,0:02:01.175 So click Continue. 0:02:01.175,0:02:03.110 The next thing we're[br]going to look at 0:02:03.110,0:02:05.045 is this numeric[br]expression box. 0:02:05.045,0:02:06.530 And will actually[br]come back 0:02:06.530,0:02:07.730 to this in just a minute, 0:02:07.730,0:02:08.390 but this is where you're 0:02:08.390,0:02:09.330 going to be doing most 0:02:09.330,0:02:11.390 of the work when you're[br]computing a variable. 0:02:11.390,0:02:13.190 What you'll want[br]to go to next 0:02:13.190,0:02:14.880 is this function[br]group area. 0:02:14.880,0:02:16.665 So I'm going to[br]click on All. 0:02:16.665,0:02:18.630 And you notice right[br]below it we've 0:02:18.630,0:02:20.580 got these functions[br]and special variables, 0:02:20.580,0:02:22.815 and this popped up[br]when I clicked on All. 0:02:22.815,0:02:24.550 This has a whole bunch of 0:02:24.550,0:02:26.200 different pre-existing[br]functions, 0:02:26.200,0:02:27.640 so you don't need to[br]reinvent the wheel, 0:02:27.640,0:02:28.870 you can basically use 0:02:28.870,0:02:30.950 these pre-existing[br]functions to 0:02:30.950,0:02:33.135 help you compute[br]this new variable. 0:02:33.135,0:02:34.710 I'm going to go[br]down to sum, 0:02:34.710,0:02:36.250 and these are in[br]alphabetical order, 0:02:36.250,0:02:37.890 so it's pretty[br]easy to find. 0:02:37.890,0:02:40.180 Here we have sum, and[br]when I click on sum, 0:02:40.180,0:02:41.490 you'll notice[br]that this box on 0:02:41.490,0:02:43.955 the left populated[br]with some text. 0:02:43.955,0:02:46.005 This box is actually[br]pretty useful. 0:02:46.005,0:02:47.650 So the first thing[br]it shows you is 0:02:47.650,0:02:48.570 an example of what 0:02:48.570,0:02:50.210 this expression[br]is going to be. 0:02:50.210,0:02:51.540 And our expression[br]sounds like 0:02:51.540,0:02:52.635 a really fancy term. 0:02:52.635,0:02:54.050 If you've ever[br]used a formula 0:02:54.050,0:02:55.670 in Excel, it's[br]basically that. 0:02:55.670,0:02:56.990 It's telling the computer 0:02:56.990,0:02:58.465 what it needs to do. 0:02:58.465,0:03:00.750 In this case,[br]just like Excel, 0:03:00.750,0:03:02.030 we've got the word sum, 0:03:02.030,0:03:03.570 which tells the computer[br]it's going to be 0:03:03.570,0:03:05.365 summing different[br]values together, 0:03:05.365,0:03:06.630 and then in parentheses, 0:03:06.630,0:03:07.570 immediately after that, 0:03:07.570,0:03:09.070 we have different[br]variables 0:03:09.070,0:03:10.705 that are separated[br]by a comma, 0:03:10.705,0:03:11.930 and that's what tells the 0:03:11.930,0:03:13.390 computer to add x, y, 0:03:13.390,0:03:15.150 and z things[br]together to create 0:03:15.150,0:03:17.800 a new variable or[br]compute a new variable. 0:03:17.800,0:03:18.870 This also provides 0:03:18.870,0:03:20.750 additional extra[br]content here, 0:03:20.750,0:03:22.190 but we don't need to[br]worry about that. 0:03:22.190,0:03:23.930 I found this is[br]helpful if you 0:03:23.930,0:03:26.000 are stuck or something[br]isn't working right. 0:03:26.000,0:03:27.930 So we've got sum selected, 0:03:27.930,0:03:29.780 we're going to be[br]summing the items of 1, 0:03:29.780,0:03:31.760 2, 3, 4, 5, and[br]6 together. 0:03:31.760,0:03:33.055 We've got that selected. 0:03:33.055,0:03:34.110 So the next thing you do 0:03:34.110,0:03:35.190 is click this up arrow, 0:03:35.190,0:03:36.270 which basically takes 0:03:36.270,0:03:38.030 that pre-existing function 0:03:38.030,0:03:39.720 and it kicks it up[br]to this numeric 0:03:39.720,0:03:41.550 and expression box. 0:03:41.550,0:03:43.870 The next thing that[br]we're going to do, 0:03:43.870,0:03:44.710 we've already told 0:03:44.710,0:03:45.810 the computer[br]that we're going 0:03:45.810,0:03:47.740 to sum different[br]variables together, 0:03:47.740,0:03:48.910 we need to tell it which 0:03:48.910,0:03:50.480 variables to sum together. 0:03:50.480,0:03:52.790 So the easy way[br]to do this is to 0:03:52.790,0:03:54.110 click on the first 0:03:54.110,0:03:55.445 item that you[br]want to include, 0:03:55.445,0:03:57.850 and you'll notice[br]that this arrow 0:03:57.850,0:03:59.290 switch sides from pointing 0:03:59.290,0:04:00.785 to the left to[br]pointing to the right, 0:04:00.785,0:04:02.060 click over 1, 0:04:02.060,0:04:04.350 and we've already[br]moved over item 1. 0:04:04.350,0:04:07.020 What you need to be[br]careful of is that you 0:04:07.020,0:04:09.640 always have a comma[br]after each variable, 0:04:09.640,0:04:11.085 except for the last one. 0:04:11.085,0:04:12.600 So a comma is[br]already here, 0:04:12.600,0:04:14.815 but what I usually do[br]is I just hit a comma, 0:04:14.815,0:04:16.675 I go to item 2, 0:04:16.675,0:04:19.010 kick that over, comma, 0:04:19.010,0:04:21.030 item 3, kick that over, 0:04:21.030,0:04:23.550 comma, item 4,[br]kick that over, 0:04:23.550,0:04:25.260 comma, item 5, 0:04:25.260,0:04:26.880 kick that over, comma, 0:04:26.880,0:04:28.935 item 6, kick that over. 0:04:28.935,0:04:30.420 Now, we know that item 6 0:04:30.420,0:04:31.920 is the last one we have, 0:04:31.920,0:04:33.690 the last variable[br]we're including, 0:04:33.690,0:04:35.100 so what we're[br]going to do is 0:04:35.100,0:04:36.700 just delete out[br]that question mark, 0:04:36.700,0:04:38.515 we're going to delete[br]out that last comma, 0:04:38.515,0:04:40.260 and then if we read[br]through this real quick 0:04:40.260,0:04:40.980 just to make sure we 0:04:40.980,0:04:42.190 don't have any problems, 0:04:42.190,0:04:45.095 we've got creating[br]sumofitems, 0:04:45.095,0:04:46.880 this is going to[br]be the sum of 0:04:46.880,0:04:48.435 item 1, 2, 3, 0:04:48.435,0:04:51.280 4, 5, and 6, 0:04:51.280,0:04:54.095 and what we're going[br]to do now is click OK. 0:04:54.095,0:04:56.620 An output window pops 0:04:56.620,0:04:57.720 up and it basically tells 0:04:57.720,0:04:58.860 you what the computer did. 0:04:58.860,0:05:00.500 It computed the[br]sum of items, 0:05:00.500,0:05:01.830 which was the[br]sum of item 1, 0:05:01.830,0:05:03.315 2, 3, 4, 5, and 6, 0:05:03.315,0:05:05.110 it gives us the[br]variable label, 0:05:05.110,0:05:08.620 it gives us that[br]descriptive text I put in. 0:05:08.620,0:05:10.080 I'm just going to[br]minimize this window, 0:05:10.080,0:05:11.280 and if we look back here, 0:05:11.280,0:05:12.200 you might notice that 0:05:12.200,0:05:13.620 there's this new column, 0:05:13.620,0:05:15.510 this new variable,[br]that sumofitems, 0:05:15.510,0:05:16.935 that wasn't there[br]when we started, 0:05:16.935,0:05:19.155 and that's because[br]SPSS computed that. 0:05:19.155,0:05:20.780 And if we add[br]these together, 0:05:20.780,0:05:22.235 if you add each row, 0:05:22.235,0:05:24.320 we've got 1, 2, 1, 3, 5, 0:05:24.320,0:05:26.565 1, that adds to 13, 0:05:26.565,0:05:28.005 5, 1, 2, 0:05:28.005,0:05:29.940 3, 5, 1 adds to 17. 0:05:29.940,0:05:31.540 So it's done that[br]math for us. 0:05:31.540,0:05:33.425 We didn't have to[br]manually do it. 0:05:33.425,0:05:35.720 I know, yes, it'd[br]be pretty easy to 0:05:35.720,0:05:38.280 manually do this[br]for 10 cases, 0:05:38.280,0:05:41.060 but if you have a dataset[br]that has 500 cases, 0:05:41.060,0:05:43.000 that would be very[br]time-consuming to do. 0:05:43.000,0:05:45.460 And you could see[br]that this function of 0:05:45.460,0:05:47.360 computing this[br]variable can 0:05:47.360,0:05:48.460 save you a lot of time. 0:05:48.460,0:05:49.820 It's also more accurate. 0:05:49.820,0:05:51.385 It's going to[br]take any error 0:05:51.385,0:05:53.790 out of the equation. 0:05:53.790,0:05:54.940 And we know that often 0:05:54.940,0:05:56.120 when we do things by hand, 0:05:56.120,0:05:57.900 we can introduce[br]error into things, 0:05:57.900,0:05:59.550 so we want to avoid that. 0:05:59.550,0:06:01.845 That's one way to[br]computer a variable. 0:06:01.845,0:06:04.760 I'm going to show[br]you a different type 0:06:04.760,0:06:06.160 of variable that[br]we can compute. 0:06:06.160,0:06:07.845 I'm going to go[br]back to Transform, 0:06:07.845,0:06:09.570 I'm going to go back[br]to Compute Variable. 0:06:09.570,0:06:11.420 I'm actually going[br]to clear this out. 0:06:11.420,0:06:12.860 We're done with[br]someofitems, 0:06:12.860,0:06:13.840 we don't need to[br]worry about it, 0:06:13.840,0:06:15.280 we're not going to use[br]the same expression, 0:06:15.280,0:06:16.140 so I'm going to click 0:06:16.140,0:06:17.835 Reset in the bottom here. 0:06:17.835,0:06:20.240 So what I want[br]to do is create 0:06:20.240,0:06:22.540 the mean of the different[br]items that we have. 0:06:22.540,0:06:24.000 Sometimes if[br]you're working 0:06:24.000,0:06:26.100 with a pre-existing scale, 0:06:26.100,0:06:28.320 it might tell you to add 0:06:28.320,0:06:29.740 all the items[br]together and then 0:06:29.740,0:06:31.340 that's what represents 0:06:31.340,0:06:34.225 that theoretical concept[br]or that measure, 0:06:34.225,0:06:36.380 sometimes it might tell[br]you to use the mean. 0:06:36.380,0:06:38.600 So what I want to do[br]is compute both of 0:06:38.600,0:06:39.720 these things because they 0:06:39.720,0:06:41.295 both might be[br]helpful to me. 0:06:41.295,0:06:42.860 So what I'm going to do is 0:06:42.860,0:06:44.990 I'm going to type[br]meanofitems. 0:06:44.990,0:06:47.240 And again, that very[br]quickly lets me 0:06:47.240,0:06:48.230 differentiate between 0:06:48.230,0:06:49.970 sumofitems and[br]meanofitems. 0:06:49.970,0:06:51.700 Type & label, and again, 0:06:51.700,0:06:54.720 I'm just going to put[br]mean of items 1 through 0:06:54.720,0:07:01.905 6, click Continue. 0:07:01.905,0:07:04.900 Just like we did[br]before, click on All, 0:07:04.900,0:07:06.380 and then we're[br]going to go down 0:07:06.380,0:07:10.335 to mean, here's mean. 0:07:10.335,0:07:11.790 And when I click[br]on that, again, 0:07:11.790,0:07:14.090 it gives me that[br]sample text here. 0:07:14.090,0:07:16.975 This is very similar[br]to what we did before. 0:07:16.975,0:07:19.330 I'm going to click up, and 0:07:19.330,0:07:21.505 we're going to[br]kick over 1, 0:07:21.505,0:07:29.610 2, 3, 4, 5, and then 6. 0:07:29.610,0:07:31.070 I'm making sure to not 0:07:31.070,0:07:33.835 include this last[br]one, this sumofitems. 0:07:33.835,0:07:35.250 And then just[br]like last time, 0:07:35.250,0:07:36.150 we're going to delete out 0:07:36.150,0:07:37.280 that question mark,[br]that last comma. 0:07:37.280,0:07:38.790 We're going to[br]read through 0:07:38.790,0:07:40.505 it really quickly just[br]to avoid an error. 0:07:40.505,0:07:42.820 We've got a new[br]variable, meanofitems. 0:07:42.820,0:07:44.835 It's going to be[br]the mean of item 1, 0:07:44.835,0:07:47.265 2, 3, 4, 5, and 6. 0:07:47.265,0:07:51.130 I'm going to[br]click OK. SPSS 0:07:51.130,0:07:53.895 again showed me the[br]syntax of what it did. 0:07:53.895,0:07:55.695 I'm going to[br]minimize that. 0:07:55.695,0:07:58.080 And then here we have[br]the mean of items. 0:07:58.080,0:08:00.010 And if we really[br]quickly look at this, 0:08:00.010,0:08:01.990 I'm going to pick this[br]one, for example, 0:08:01.990,0:08:03.700 we've got 1, 0:08:03.700,0:08:06.110 1, 3, 3, 1, 2, 0:08:06.110,0:08:07.710 and a mean of 1.83 would, 0:08:07.710,0:08:09.975 just eyeballing[br]it, make sense. 0:08:09.975,0:08:11.580 If we look at this one, 0:08:11.580,0:08:13.590 3.67, 2, 0:08:13.590,0:08:15.645 3, 5, 4, 5, 3, 0:08:15.645,0:08:16.990 that would roughly[br]make sense 0:08:16.990,0:08:18.650 without having to[br]do the math of it, 0:08:18.650,0:08:21.310 but this has computed[br]the average score, 0:08:21.310,0:08:24.450 the mean score for all[br]six of those items. 0:08:24.450,0:08:26.590 So that is very[br]quickly how to 0:08:26.590,0:08:28.810 compute a new[br]variable in SPSS. 0:08:28.810,0:08:30.410 This is[br]particularly useful 0:08:30.410,0:08:32.190 when you have[br]collected data using 0:08:32.190,0:08:34.610 a pre-existing measure[br]and that measure has 0:08:34.610,0:08:36.310 instructed you to compute 0:08:36.310,0:08:38.510 the sum of items and[br]run your tests on that, 0:08:38.510,0:08:39.930 or maybe the mean of items 0:08:39.930,0:08:41.450 and run your[br]tests on that. 0:08:41.450,0:08:43.130 But this is a useful way 0:08:43.130,0:08:44.450 of understanding[br]how to create 0:08:44.450,0:08:48.190 new variables using[br]existing ones in SPSS.