楼主: ayujt
6607 2

[问答] 请教spss数据编码的问题 [推广有奖]

  • 3关注
  • 0粉丝

大专生

20%

还不是VIP/贵宾

-

威望
0
论坛币
145 个
通用积分
0
学术水平
5 点
热心指数
9 点
信用等级
5 点
经验
326 点
帖子
11
精华
0
在线时间
80 小时
注册时间
2006-4-19
最后登录
2018-7-30

+2 论坛币
k人 参与回答

经管之家送您一份

应届毕业生专属福利!

求职就业群
赵安豆老师微信:zhaoandou666

经管之家联合CDA

送您一个全额奖学金名额~ !

感谢您参与论坛问题回答

经管之家送您两个论坛币!

+2 论坛币
在spss因子分析时,有不同类型的题项,有的是用李克特态度量表,数据值只是在1~7之间,有的是用实际数据,比如价格,数值就很大。那么在编码的时候如何处理? 请各位大哥帮帮小妹!
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

关键词:spss数据 SPSS PSS SPSS因子分析 实际数据 数据 SPSS 编码

回帖推荐

hanszhu 发表于2楼  查看完整内容

Internet Guide to SPSS for Windows RECODE The RECODE command is used to change some or all values of a variable. The new values can be stored in the same variable or in a new one. Simple example: RECODE var1 var2 (1,2 = 1) (3,4 = 2). More complex example: RECODE var1 (1,2 = 1) (3 thru 8 = 2) (missing = 99) (else = copy) INTO var1new. General Assume we have variable famimpor with valu ...

hanszhu 发表于3楼  查看完整内容

SPSS Learning ModuleCreating and recoding variables http://www.ats.ucla.edu/stat/spss/modules/vars.htm

本帖被以下文库推荐

沙发
hanszhu 发表于 2006-5-16 12:57:00 |只看作者 |坛友微信交流群
Internet Guide to SPSS for Windows

RECODE

The RECODE command is used to change some or all values of a variable. The new values can be stored in the same variable or in a new one.

Simple example:

RECODE var1 var2 (1,2 = 1) (3,4 = 2).

More complex example:

RECODE var1 (1,2 = 1) (3 thru 8 = 2) (missing = 99) (else = copy)
INTO var1new.


General

Assume we have variable famimpor with values 1, 2, 3 and 4, measuring how important having a family is for the respondent.

RECODE famimpor (4=3).

This changes all occurrences of value 4 to value 3. The original value 3 remains unchanged. (If you have value labels, perhaps you should change these now accordingly). All other values remain unchanged, too.

RECODE famimpor (1,2 =1) (3,4 = 2).

This creates a dichotomous variable with cut-off point between 2 and 3.

RECODE famimpor (1=4) (2=3) (3=2) (4=1).

This reverses the order of the values. Note that this can be achieved more easily with the COMPUTE command (COMPUTE famimpor = 5 - famimpor.). This may be helpful if there are many categories.


Creating New Variables

One problem is that all the above examples change the original values of the variable. You should do so only if either you can reconstruct the original values from the new ones (this would be possible only in the last example!) or if you are damn sure that you have a valid copy of your data set elsewhere. Fortunately, you can create new variables with the RECODE command by adding INTO NEWVAR. See the following examples.

RECODE famimpor (1,2 =1) (3,4 = 2) INTO famimpod.

This creates a dichotomous variable with cut-off point between 2 and 3. The old variable remains intact, however, and the dichotomous variable is added to the data set with the name famimpod (with "D" indicating that you have a dichotomous variable. I use such memotechnic devices quite frequently, but of course you don't have to.)

Note, however, that you have to take some precautions when RECODING INTO a new variable. In this case, you have to be sure that the new variable has all the valid values you wish it to have. If the RECODE command names only part of the values, all the other values will be treated as system missing values. Yet, there is an easy way to deal with this problem.

WRONG: RECODE famimpor (4=3) INTO famimpon.

This would change all occurrences of value 4 to value 3. However, all other values would be treated as system missing. Here's the better way:

RECODE famimpor (4=3) (ELSE=COPY) INTO famimpon.

This changes all occurrences of value 4 to value 3, and all other values are copied to the new variable. Of course, you can make as many explicit recodings as you like and then deal with the rest via ELSE=COPY.

The ELSE part of the RECODE command is not restricted to the "COPY" case just explained. You can also use it with explicit values, as in the following example:

RECODE famimpor (4,3=2) (ELSE=1) INTO famimpor.

One problem with RECODE INTO, however, is that variable and value labels are not automatically created (how should they?). So don't forget to label the new variable.


Several variables

can be addressed in one RECODE statement, provided that all variables are to be affected in the same way, as in the following example.

RECODE famimpor workimpo chldimpo (4,3=2) (ELSE=1).

However, if you wish to RECODE these variables INTO new variables, for each variable a separate RECODE command line is necessary.


Treatment of Missing Values

Missing values can be addressed via the keywords "sysmis" or "missing".

Assume that in addition to the values 1 thru 4, there are also values 8 and 9 which are defined as missing values. Here's a few examples and what they do.

RECODE famimpor (missing = 8).

All missing values (i.e., values 8 and 9 and perhaps also system missing values) will have the value 8. 8 will still be defined as missing.

RECODE famimpor (missing = 7).

All missing values (i.e., values 8 and 9 and perhaps also system missing values) will have the value 7. 7 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 famimpor (sysmis = 7).

Again, if you have defined values 8 and 9 as missing, 7 will not be recognized as a (formerly) missing value. You may wish to either define 7 now as missing or to assign a value label that tells you the meaning of 7.


Simplifications

Often, several values of a variable have to be addressed. Some keywords help to make this process easier.

RECODE famimpor (lowest thru 3 = 3).
RECODE famimpor (2 thru highest = 2).

The first command recodes all values from the lowest value to (and including) value 3 into the value 3. The second command recodes all values from the value 2 to (and including) the highest value into the value 2. Note that "lowest" can be abbreviated as "lo" and "highest" as "hi". CAUTION: Assuming that 8 and 9 are still defined as user missing values, these will be recoded to 2 in the last example (and of course won't be defined as missing anymore).

已有 1 人评分经验 论坛币 收起 理由
bakoll + 10 + 10 热心帮助其他会员

总评分: 经验 + 10  论坛币 + 10   查看全部评分

使用道具

藤椅
hanszhu 发表于 2006-5-16 12:59:00 |只看作者 |坛友微信交流群

SPSS Learning Module
Creating and recoding variables

http://www.ats.ucla.edu/stat/spss/modules/vars.htm

使用道具

您需要登录后才可以回帖 登录 | 我要注册

本版微信群
加好友,备注cda
拉您进交流群

京ICP备16021002-2号 京B2-20170662号 京公网安备 11010802022788号 论坛法律顾问:王进律师 知识产权保护声明   免责及隐私声明

GMT+8, 2024-4-23 22:20