“SPSS:数据读取与管理”的版本间的差异

来自OBHRM百科
跳转至: 导航搜索
第23行: 第23行:
 
第四行:mbi1 to mbi16 1-16 sex 17 age 18 edu 19 manage 20 year 21-22 month 23-24</pre>
 
第四行:mbi1 to mbi16 1-16 sex 17 age 18 edu 19 manage 20 year 21-22 month 23-24</pre>
 
数据读取方法
 
数据读取方法
<pre>Data list file= 'd:\01A.txt'  fixed records 4
+
<pre>
 +
*根据以上数据说明,从D盘根目录下的01A.txt文件读取数据,并保存为01A.sav.
 +
Data list file= 'd:\01A.txt'  fixed records 4
 
/company 1-2 group 3-4 num 5-7 item1 to item17 8-24  
 
/company 1-2 group 3-4 num 5-7 item1 to item17 8-24  
 
         /item18 to item43 1-26
 
         /item18 to item43 1-26

2017年3月9日 (四) 20:32的版本

从文本文件读取固定格式的数据

如果您的数据还没有输入计算机,建议直接以txt格式(ASCII)输入数据。可以用Windows系统自带的Edit,或者Editplus、Notepad++输入数据。输入完成后,直接用固定格式读取数据。

示例数据

010103643424242343243334
23333344343244333434444433
33334333343333334433333222
1211316013333114213
010103533434332332 23432
243433334234 3334244434433
43222333332242323343322334
2232323233433336213   06
010103443334442234343434
22444224344342343334443433
43222444443434344444444222
02212011223222132242  10

示例数据说明

所有数据分为四行,具体为:
第一行:company 1-2 group 3-4 num 5-7 item1 to item17 8-24 
第二行:item18 to item43 1-26
第三行:item44 to item69 1-26
第四行:mbi1 to mbi16 1-16 sex 17 age 18 edu 19 manage 20 year 21-22 month 23-24

数据读取方法

*根据以上数据说明,从D盘根目录下的01A.txt文件读取数据,并保存为01A.sav.
Data list file= 'd:\01A.txt'  fixed records 4
	/company 1-2 group 3-4 num 5-7 item1 to item17 8-24 
        /item18 to item43 1-26
        /item44 to item69 1-26
	/mbi1 to mbi16 1-16 sex 17 age 18 edu 19 manage 20 year 21-22 month 23-24.
Execute.
SAVE OUTFILE='d:\01A.sav'   /COMPRESSED.
Execute.