3. 变量批量增加值(value)和标签(value label) 当变量的值和值标签很多时,如果直接在SPSS软件中操作,后期维护非常不便。更好的方法是在语法窗口输入如下命令: STRING school (A50). VALUE LABELS school 1 A学校 2 B学校 3 C学校.EXECUTE. 上述命令首先创建一个名为“school”的新字符型变量,然后依次读取变量...
Regarding our data file, note invariable viewthatemot_1throughemot_5are string variables. We'll now AUTORECODE the first one and inspect the result with thesyntaxbelow. SPSS AUTORECODE - Syntax Example 1 *1. Create numeric variable emo_1 from string emot_1. ...
SPSS Recode Syntax Example 7*1. Create mini dataset.data list free / s1(a10).begin data'Very bad' 'Bad' 'Neutral' 'Good' 'Very good'end data.*2. Recode string into numeric variable.recode s1 ('Very bad' = 1)('Bad' = 2) ('Neutral' = 3)('Good' = 4)('Very good' = 5) ...
Syntax for the RECODE command can be generated from the Recode into Same Variables dialog or the Recode into Different Variables dialog. Examples RECODE V1 TO V3 (0=1) (1=0) (2,3=-1) (9=9) (ELSE=SYSMIS). RECODE STRNGVAR ('A','B','C'='A')('D','E','F'='B')(ELSE='...
COPYreplicates original values without recoding them. INTOis required to recode a string variable into a numeric variable or a numeric variable into a string variable. Parent topic:RECODE
AUTORECODErecodes the values of string and numeric variables to consecutive integers and puts the recoded values into a new variable called atarget variable. The value labels or values of the original variable are used as value labels for the target variable. ...
Value.Individual old value to be recoded into a new value. The value must be the same data type (numeric or string) as the variable(s) being recoded. System-missing.Values assigned by the program when values in your data are undefined according to the format type you have specified, when...
Select the variables you want to recode. If you select multiple variables, they must be the same type (numeric or string). Enter an output (new) variable name for each new variable. ClickRecode Values. Specify an old value and a new value. ...
Syntax for theRECODEcommand can be generated from theRecode into Same Variablesdialog or theRecode into Different Variablesdialog. Examples RECODE V1 TO V3 (0=1) (1=0) (2,3=-1) (9=9) (ELSE=SYSMIS). RECODE STRNGVAR ('A','B','C'='A')('D','E','F'='B')(ELSE=' ')....
When recoding INTO another variable, unspecified values are set to system-missing or blank for strings. COPY replicates original values without recoding them. INTO is required to recode a string variable into a numeric variable or a numeric variable into a string variable. Numeric Variables (...