From Lawrence, Will, Mark and Andris (SPSSlog.com) a Merry Christmas and happy 2007 for all of our visitors! Since the start of SPSSlog, we’ve answered over 200 questions on SPSS… we hope to help even more SPSS users in next year.
Technorati: Posts that contain Happy Holidays per day for the last 30 days.
“I’m having problems to recode system missing values to 0 with syntax
editor. How can I do that?”
In SPSS Syntax, missing values can be addressed via the keywords “sysmis” or “missing”. For this explanation we assume that in addition to the values 1 and 2, there are also values 3 and 4 which are defined as missing values. Please find some syntax below and an explanation of what they do. var2 stands for the variable name we are recoding.
RECODE var2 (missing = 3).
All missing values (i.e., values 3 and 4 and perhaps also system missing values) will have the value 3. 3 will still be defined as missing.
RECODE var2 (missing = 15).
All missing values (i.e., values 3 and 4 and perhaps also system missing values) will have the value 15. 15 will not be defined as missing.
If you have system missing values and want to recode only these to another value, you can use the keyword “sysmis” instead of “missing”.
RECODE var2 (sysmis = 6).
Again, if you have defined values 3 and 4 as missing, 6 will not be recognized as a (formerly) missing value. You may wish to either define 6 now as missing or to assign a value label that tells you the meaning of 6.
This week we got a question from Mark Mortensen regarding Coding Ordinal Data.
“What is the best way to set up a variable and code ordinal data when it is generated by a question such as “Rank the following three items using 1 as the most use, 2 the next most use, and three, the least use?”
For this query we can consider the following example. In the following data there is three different 4 wheelers brands. The respondent gives the opinion about usage on their brand like most often, second most often and least often. It is captured brand wise. Using this syntax easily we can find out which brand is most often, second most often and least often. This recoding we can do vise-versa based on data capturing. Â
Data: Audi     BMW   Benz
——- Â ——- ——–
1Â Â Â Â Â Â Â Â Â 2Â Â Â Â Â Â Â Â Â 3
2Â Â Â Â Â Â Â Â Â 3Â Â Â Â Â Â Â Â Â 1
3Â Â Â Â Â Â Â Â Â 1Â Â Â Â Â Â Â Â Â 2
1- Most often   Â
2-Second most often
3-least often
*** The following syntax will recode the respondent’s opinion into new variable rank1, 2 and 3.
IF (Audi =1) Rank1 = 1.
IF (BMW =1) Rank1 = 2.
IF (Benz =1) Rank1 = 3.
Execute.
IF (Audi =2) Rank2 = 1.
IF (BMW =2) Rank2 = 2.
IF (Benz =2) Rank2 = 3.
Execute.
IF (Audi =3) Rank3 = 1.
IF (BMW =3) Rank3 = 2.
IF (Benz =3) Rank3 = 3.
Execute.
Variable label
Rank1 ‘Most Often’
Rank2 ‘Second Most Often’
Rank3 ‘Least Often’.
Value label Rank1 Rank2 Rank3
1 “Audi”
2 “BMW”
3 “Benz”.
After using this syntax we will get the new variables like in this way,
Rank1 Â Rank2Â Â Rank3
——-Â Â —— Â ——–
Audi     BMW   Benz
Benz    Audi     BMW
BMW    Benz    Audi
The following link is the simple example for recoding in SPSS and it’s explaining the purpose also. After reading this content, I welcome more discussion on this. At the end all the SPSS Log users will get more information about recoding in SPSS with more examples. In SPSS we have two different method of recoding (Recode into same variable and Recode into Different variable). We will discuss the features and utilization of these two functions from different applications.Â
Are you currently involved in survey research? Or are you developing a survey for the first time? Regardless of your level of experience, SPSS Survey Tips can help you plan, develop, and execute surveys.
In April this year SPSSlog.com was started by Mark and Andris. We have started the log to help people who are struggling with SPSS. Currently we get 50-70 visitors each day, from all over the world. In the few months of the existing of SPSSlog.com we have gotten a lot of questions. Very diverse questions, basic questions like “How do I obtain an overall rating score for a number of Likert scale variables?†but also very statistical orientated questions about the many statistical calculations in SPSS.
In our work we do not get much involved with the different statistical analysis and methods. So we do not have much experience or knowledge in that area. We are looking for someone who is willing to answer statistical questions for us. Remember, our work and website is voluntary.
Are you:
- working with SPSS on a daily basis
- experienced in different statistical methods and analysis
- willing to answer 1-2 questions per week on this subject
“I am writing about the stereotypes that people hold in regard to public service employees. Participants are required to rate a private, state, federal and local employee on a number of ratings such as efficiency. It is a 7 point Likert scale.
How do I obtain an overall rating score for each participant for each level of employee?”
Cameron, I assume you have already got your data into SPSS. I also assume you have put each score in a different variable and scored every variable with a figure from 1 to 7. To create an overall rating, you can use the Compute function. You can find this under Transform -> Compute.
(Click image for large view)
In the field Target Variable, you fill in the name of a (new) variable which should contain the overall rating.
In the field Numeric Expression you create a formula by typing or clicking the right buttons, like the following:
(var1+var2+var3+var4)/4
In this formula the 4 stands for the number of variables.
When you are finished, press OK.
In the newly created variable you can now find the overall score. If you have any questions about SPSS, please do not hesitate to contact us.
We got a question from Lucinda, who wants to publish her results, but has a problem with the resolution of the output. She asked us:
“I have made some interactive line graphs that have been submitted to a scientific journal for publication. The journal editor says that the resolution of the graphs is not high enough to print. Do you know how I can increase the resolution of the graphs?”
You can export your graphs into different file formats:
1. Rightclick your chart (in the Output window)
2. Choose Eport, which gives you the following pop-up screen:
3. Set the file type to Postscript (EPS). This is the file format most graphical guys (DTP-ers) can handle this format without a problem. Set the other options according to your wishes, and press OK.
If you have any other questions, please don’t hesitate to contact us.
We received a question from Ilan Shrira, who got an error while saving a file:
I just bought a 120 gigabyte external hard drive, and whenever I try to save an SPSS file
that’s more than 4 gigabyte onto it, it stops and says “Warning #5322, The attempt to save the data file has failed because the disk is full, an I/O error has occurred, the variable dictionary is invalid, or the task was interrupted”
I didn’t have any trouble saving 2 or 3 gigabyte files of the save type. Is is possible that there’s some other kind of glitch in my file.”
To our information there is no limitation in file size, variables or cases. This information is not checked with SPSS, since we do not have a support contract. If anyone else has and is willing to ask SPSS about this, we would be very thankfull. But, the cause is probably an error in the data or variables.
The error has been discussed in the SPSSX-L mailinglist. In this discussionRaynald Levesque suggests the following cause to the problem:
“If you have string variables, check that the number of characters differs
from the declared length of that variable.
eg if you have a variable declared as format A2 but that variable contains 3
characters. In recent versions of SPSS, more integrity tests are performed
when saving a file and this would cause an error.”
You can check your file by hand or use the automated method Raynald suggest in his second post.
We get a lot of questions about regression analysis. We have dug into this and decided to write a post about it, so we can help everyone with this.
You do a regression when you assume that a variable is influencing another one, like in the following example: We assume that cars that run on Diesel have higher costs.
To test this assumption, we run a Linear Regression in SPSS. Take the following steps:
- Define your dependent and independent variable. In our example Fuel is the indepent variable and Costs is the dependent one.
- Click Analyze - Go to Regression and click Linear - Click “Fuel” into the Independent variable field, and “Costs” into the Dependent variable field.
The output exists of:
1 Model Summary, in which you can find the relation between the variables.
R stands for the correlation and gives us the relation between the dependent and the independent variables. The correlation between Fuel and Costs is ,839.
R Square is the proportion of variance in the dependent variable (Costs) which can be predicted from the independent variable (Fuel). This value indicates that 70% of the variance in costs can be predicted from the variable fuel. The Adjusted R-square tries to give an even better calculation for the whole population.
2 ANOVA, which holds data about the significance of the regressionmodel.
The value under Sig. holds the significance value of the regression. In most cases this should be under 0.05. In our example this is 0.00, better it cannot get!
3 Coefficients, gives information about the first line of regression.
Conclusion would be that this regression analysis is significant and that 70% of the variance in costs can be predicted from the variable fuel.
Please find below the SPSS file we used to create this example. Just one note, the information in the SPSS file is not based on anything. Even more, it’s just random data. Please don’t sue us.