spss

How can I check the measure (nominal/ordinal/scale) of a variable using syntax?

一世执手 提交于 2019-12-11 02:18:58
问题 I would like to find the measure of a variable using syntax and then use this in an If-statement. Is this possible using syntax? For example, if I have two variables a (nominal) and b (ordinal): DO IF (a is nominal?) ... END IF 回答1: You can create a list of all the nominal variables in your data. In the following example the list will be stored under the macro call !noms : SPSSINC SELECT VARIABLES MACRONAME="!noms" /PROPERTIES LEVEL=NOMINAL. * now, for example you can run frequencies on all

SPSS: summing up multiple variable scores depending on their score

倖福魔咒の 提交于 2019-12-11 01:47:09
问题 tl;dr: I need to first dichotomize a set of variables to 0/1, then sum up these values. I need to do this for 14x8 variables, so I am looking for a way to to this in a loop. Hi guys, I have a very specific problem I need your help with: Description of problem: In my dataset I have 14 sets of 8 variables each (e.g. a1 to a8, b1 to b8, c1 to c8, etc.) with scores ranging from 1 to 6. Note that the variables are non-contiguous, with string variables in between them (which I need for a different

Using a variable in a conditional sentence

六眼飞鱼酱① 提交于 2019-12-10 23:05:46
问题 I want to save a value in a variable and then use it in a conditional sentence. To clarify this I'll give you a simpler example: Imagine that I have a database with the kind of animal(dogs and cats),their age(1 or 2) and their weight. I want to do the following conditional: IF( animal=dog & age=1 & weight>= percentile75 ) Wdogs=1. EXECUTE. IF( animal=dog & age=1 & weight<percentile75) Wdogs=0. EXECUTE I want to calculate percentile75 automatically and save in a variable so I can use the code

How to invert an axis in SPSS?

为君一笑 提交于 2019-12-10 22:26:43
问题 This question was migrated from Psychology & Neuroscience Stack Exchange because it can be answered on Stack Overflow. Migrated 5 years ago . Is it possible to invert an axis in an SPSS graph, say from -1,0,1 to 1,0,-1 without using code?I have only been able to change the axes' coordination from x to y and reverse which was not what I wanted. I know inverting is possible with a code (or so they say in some forums) but I have zero knowledge on programming and I would prefer an easier way if

Importing values and labels from SPSS with memisc

你说的曾经没有我的故事 提交于 2019-12-10 11:41:02
问题 I want to import both values and labels from a dataset but I don't understand how to do it with this package (the documentation is not clear). I know it is possible because Rz (a gui interface for R) uses memisc to do this. I prefer, though, not to depend on too many packages. Here the only piece of code I have: dataset <- spss.system.file("file.sav") 回答1: See the example in ?importer() which covers spss.system.file() . spss.system.file creates an 'importer' object that can show you variable

Quickly import custom SPSS commands from Python

▼魔方 西西 提交于 2019-12-10 10:03:14
问题 I have written a neat Python module that contains some custom SPSS functions for my coworkers to use. However, to use the functionality, they first need to type BEGIN PROGRAM. Import module etc... before actually calling the function. Because most of them aren't tech savvy, I'm looking to make things easier. Now they have to type something like this: BEGIN PROGRAM. import sys sys.path.append("C:/Python scripts") import mymodule mymodule.custom_function('a','c') END PROGRAM. Is there a way I

Warning / Error when Importing a .sav

こ雲淡風輕ζ 提交于 2019-12-10 02:36:39
问题 I have two versions of SPSS at work. SPSS 11 running on Windows XP and SPSS 20 running on Linux. Both copies of SPSS work fine. Files created with either version of SPSS open without incident on the other version of SPSS. I.E. - I can create a .sav file with SPSS 20 on Linux and open it on SPSS 11 on Windows without incident. But, if I create a .sav file with SPSS 20 and import the data into either R or PSPP (on Linux), I get a bunch of warnings. The data appears to import correctly, but I am

Reading Centroid extracted factor matrix into SPSS for rotation, analysis

拜拜、爱过 提交于 2019-12-08 05:44:26
问题 This question was migrated from Cross Validated because it can be answered on Stack Overflow. Migrated 3 years ago . UPDATE: 4/28 I found the proper syntax to import my centriod factor extraction into SPSS and rotate it. Because of limitations in SPSS on what subcommands can be used when reading a matrix in via MATRIX IN (...), I still need to find a way to get the FSCORE and save the new variable (/SAVE REG(ALL) ), but that is another post. What I believe to be the correct syntax is below,

Difference between Multiple Response Sets Under “Data” and “Analyze” Menus in SPSS

允我心安 提交于 2019-12-08 05:13:06
问题 SPSS appears to have two different ways to define multiple response variable sets--one under the "Data" menu and another under the "Analyze" menu. Typically, I use the "Analyze" option when working with these types of variables, but I'm not quite sure what the "Data" options does. Clearly, the sets defined under "Data" cannot be used in the freq or crosstab procedures used in the "Analyze" version. I've heard that the "Data" sets may only be for creating charts in Chart Builder, but I'm

How to source a syntax file from another syntax file in SPSS?

我怕爱的太早我们不能终老 提交于 2019-12-07 12:19:25
问题 In R there is the source function where you can source an R script from another R script. I want to be able to do the same in SPSS. How can I source an SPSS syntax file from another SPSS syntax file? 回答1: Updated Following @AndyW's comments. There is the INSERT and INCLUDE commands. INSERT is newer and more versatile than INCLUDE . See documentation on INSERT here. The following is the basic syntax template: INSERT FILE='file specification' [SYNTAX = {INTERACTIVE*}] {BATCH } [ERROR =