![spss code new variable spss code new variable](https://mattchoward.files.wordpress.com/2017/11/dummy-coded-regression-in-spss-21.png)
There’s no need to use the manual time-consuming method in SPSS because you can simply calculate the mean of a group of items even when there are missing values, and the outcome is mathematically equivalent to manual pro-rating. For instance, there are some analyses (like Cronbach’s alpha) where we shouldn’t ever use prorated scores. That method works, but it’s very time consuming and it also has some drawbacks. You’d calculate that it’s 3, and so you’d enter ‘3’ into the blank cell. if Alex answered 1, 5, _, 3, then you’d take a mean of 1, 5, and 3. The usual way to do prorating, before the complete adoption of statistical software, was to take the mean of all the items on a scale (or sub-scale) that the participant did answer, and put that mean in place of each missing value. In psychology, when we have missing values on a single psychometric scale (a measure of a single construct), it’s fairly usual to prorate (or pro-rate). You can see from the screenshot just above, SPSS has calculated a mean, even though it wouldn’t calculate a total for the second participant in my fake dataset.Įven though it’s useful to know that SPSS does still calculate a mean, this can cause the opposite problem, that it does calculate a mean even when you have so much missing data for a participant that you really shoudn’t be! If you want to do this with the graphical user interface, you just put the MEAN(var1, var2, var3) bit in the ‘Numeric Expression’ box. (The spaces after the commas are optional, but they do make things look nicer.) You can put as many variables inside the parentheses as you need to, so long as you put a comma between them. Notice that we use the function MEAN() and we put our variables inside the parentheses, separated by commas. Here’s how we ask it to calculate a mean using syntax… COMPUTE OurNewVariable = MEAN(var1, var2, var3). Thus, SPSS ignores missing values and just storms ahead and calculates means whenever we ask it to. For instance, if we had taken a mean of Jo’s five answers, we would have got 10 (depressed) overall, despite the five missing values. SPSS understands that means are still meaningful (forgive the pun) even when we have some missing data. One way around this is to calculate means instead of totals. To prevent us from making this rookie mkstake, SPSS refuses to do the calculation when there are missing values. If you just added up a total score, though, Jo would get 50 out of a hundred, because of those five questions they left blank, and we might wrongly think they were middling on our depression scale. What if Jo Bloggs answers a 10 for half the questions, but then fails to answer the rest? As a human being looking at these scores we might think that Jo is very depressed (maximum score on the ones they did answer) and perhaps even so distressed they couldn’t bring themselves to answer the rest of the questions. Why does SPSS do this? Well, imagine that we’re adding up 10 questions on a depression scale and that each question might get an answer from 0 (happy) to 10 (depressed). If you have a missing value amongst the values you’re trying to add up, SPSS will refuse to add them up, because, after all, it wouldn’t be a true answer for any participant who has a missing value. What if you have missing data? For instance, often when we run a survey study, some participants don’t want to answer certain questions, or they are having a careless moment and just skip over one or two questions. This works great for many things, but it does have one drawback. At the end, on the right, you’ll find a new column, with the name you just created, and your calculation carried out. You might find that the SPSS Output window pops up, showing you the code it ran in the background when you clicked ‘OK’ but you can ignore that. (Just like in normal maths, the + tells SPSS to add them up.)
SPSS CODE NEW VARIABLE PLUS
You just need to type a sensible name in the left-hand column, and then pace each of the variables in the right-hand ‘Numeric Expression’ box, with a plus between them. Now let’s say that you want to simply add up three variables to make a total score. Here’s what each part of the window is for… You access the Compute Variable dialogue box from the Transform menu… ⚠️ Be sure to read this post on assumption checks you should perform. This is really useful if, for instance, you want to create a total score for a psychometric scale or other questionnaire. SPSS allows you to compute new variables, based on existing ones.