thongke.info
Đang tải dữ liệu...

  
Trang chủGiới thiệuPhương pháp luậnQuản lý, phân tích số liệuCơ sở dữ liệu, xuất bản phẩmĐào tạo và tư vấnDiễn đàn
Quản lý số liệu (Data management)
Nhập liệuXử lý số liệu
Nối data files bằng SPSS
Trang chủ  >  Quản lý, phân tích số liệu  >  Quản lý số liệu (Data management)  >  Nhập liệu  >  Kết hợp các bộ số liệu (Combine data files)  >  Nối data files bằng SPSS

Nối các files dữ liệu

Xin chào các bạn,

Xin giới thiệu với các bạn lệnh nối 2 hay nhiều data files cơ bản trong SPSS.

GET FILE='C:\temp\data1.sav'.
****Add more cases from data2, data3 to active data1********
ADD FILES /FILE=* /FILE='C:\temp\data2.sav'/FILE='C:\temp\data3.sav'
execute.
SAVE OUTFILE='C:\temp\data_append.sav'.

Dưới đây thongke.info xin giới thiệu với các bạn một ví dụ nối nhiều bộ số liệu bằng phần mềm SPSS.

*Create separate files for each child for b10-b15.

GET FILE='C:\VNAS Data\b10_b15.sav'.

temp.

compute chnum=1.

select if bca1 ge 1.

save outfile='C:\VNAS Data\addch1.sav'

/keep qid chnum bca1 to b151/rename (bca1 to b151= bca b10 b11 b12 b13 b14 b15).

temp.

compute chnum=2.

select if bca2 ge 1.

save outfile='C:\VNAS Data\addch2.sav'

/keep qid chnum bca2 to b152/rename (bca2 to b152= bca b10 b11 b12 b13 b14 b15).

temp.

compute chnum=3.

select if bca3 ge 1.

save outfile='C:\VNAS Data\addch3.sav'

/keep qid chnum bca3 to b153/rename (bca3 to b153= bca b10 b11 b12 b13 b14 b15).

temp.

compute chnum=4.

select if bca4 ge 1.

save outfile='C:\VNAS Data\addch4.sav'

/keep qid chnum bca4 to b154/rename (bca4 to b154= bca b10 b11 b12 b13 b14 b15).

temp.

compute chnum=5.

select if bca5 ge 1.

save outfile='C:\VNAS Data\addch5.sav'

/keep qid chnum bca5 to b155/rename (bca5 to b155= bca b10 b11 b12 b13 b14 b15).

temp.

compute chnum=6.

select if bca6 ge 1.

save outfile='C:\VNAS Data\addch6.sav'

/keep qid chnum bca6 to b156/rename (bca6 to b156= bca b10 b11 b12 b13 b14 b15).

temp.

compute chnum=7.

select if bca7 ge 1.

save outfile='C:\VNAS Data\addch7.sav'

/keep qid chnum bca7 to b157/rename (bca7 to b157= bca b10 b11 b12 b13 b14 b15).

temp.

compute chnum=8.

select if bca8 ge 1.

save outfile='C:\VNAS Data\addch8.sav'

/keep qid chnum bca8 to b158/rename (bca8 to b158= bca b10 b11 b12 b13 b14 b15).

temp.

compute chnum=9.

select if bca9 ge 1.

save outfile='C:\VNAS Data\addch9.sav'

/keep qid chnum bca9 to b159/rename (bca9 to b159= bca b10 b11 b12 b13 b14 b15).

temp.

compute chnum=10.

select if bca10 ge 1.

save outfile='C:\VNAS Data\addch10.sav'

/keep qid chnum bca10 to b1510/rename (bca10 to b1510= bca b10 b11 b12 b13 b14 b15).

temp.

compute chnum=11.

select if bca11 ge 1.

save outfile='C:\VNAS Data\addch11.sav'

/keep qid chnum bca11 to b1511/rename (bca11 to b1511= bca b10 b11 b12 b13 b14 b15).

temp.

compute chnum=12.

select if bca12 ge 1.

save outfile='C:\VNAS Data\addch12.sav'

/keep qid chnum bca12 to b1512/rename (bca12 to b1512= bca b10 b11 b12 b13 b14 b15).

temp.

compute chnum=13.

select if bca13 ge 1.

save outfile='C:\VNAS Data\addch13.sav'

/keep qid chnum bca13 to b1513/rename (bca13 to b1513= bca b10 b11 b12 b13 b14 b15).

temp.

compute chnum=14.

select if bca14 ge 1.

save outfile='C:\VNAS Data\addch14.sav'

/keep qid chnum bca14 to b1514/rename (bca14 to b1514= bca b10 b11 b12 b13 b14 b15).

temp.

compute chnum=15.

select if bca15 ge 1.

save outfile='C:\VNAS Data\addch15.sav'

/keep qid chnum bca15 to b1515/rename (bca15 to b1515= bca b10 b11 b12 b13 b14 b15).

temp.

compute chnum=16.

select if bca16 ge 1.

save outfile='C:\VNAS Data\addch16.sav'

/keep qid chnum bca16 to b1516/rename (bca16 to b1516= bca b10 b11 b12 b13 b14 b15).

temp.

compute chnum=17.

select if bca17 ge 1.

save outfile='C:\VNAS Data\addch17.sav'

/keep qid chnum bca17 to b1517/rename (bca17 to b1517= bca b10 b11 b12 b13 b14 b15).

temp.

compute chnum=18.

select if bca18 ge 1.

save outfile='C:\VNAS Data\addch18.sav'

/keep qid chnum bca18 to b1518/rename (bca18 to b1518= bca b10 b11 b12 b13 b14 b15).

temp.

compute chnum=19.

select if bca19 ge 1.

save outfile='C:\VNAS Data\addch19.sav'

/keep qid chnum bca19 to b1519/rename (bca19 to b1519= bca b10 b11 b12 b13 b14 b15).

temp.

compute chnum=20.

select if bca20 ge 1.

save outfile='C:\VNAS Data\addch20.sav'

/keep qid chnum bca20 to b1520/rename (bca20 to b1520= bca b10 b11 b12 b13 b14 b15).

temp.

compute chnum=21.

select if bca21 ge 1.

save outfile='C:\VNAS Data\addch21.sav'

/keep qid chnum bca21 to b1521/rename (bca21 to b1521= bca b10 b11 b12 b13 b14 b15).

temp.

compute chnum=22.

select if bca22 ge 1.

save outfile='C:\VNAS Data\addch22.sav'

/keep qid chnum bca22 to b1522/rename (bca22 to b1522= bca b10 b11 b12 b13 b14 b15).

temp.

compute chnum=23.

select if bca23 ge 1.

save outfile='C:\VNAS Data\addch23.sav'

/keep qid chnum bca23 to b1523/rename (bca23 to b1523= bca b10 b11 b12 b13 b14 b15).

temp.

compute chnum=24.

select if bca24 ge 1.

save outfile='C:\VNAS Data\addch24.sav'

/keep qid chnum bca24 to b1524/rename (bca24 to b1524= bca b10 b11 b12 b13 b14 b15).

temp.

compute chnum=25.

select if bca25 ge 1.

save outfile='C:\VNAS Data\addch25.sav'

/keep qid chnum bca25 to b1525/rename (bca25 to b1525= bca b10 b11 b12 b13 b14 b15).

temp.

compute chnum=26.

select if bca26 ge 1.

save outfile='C:\VNAS Data\addch26.sav'

/keep qid chnum bca26 to b1526/rename (bca26 to b1526= bca b10 b11 b12 b13 b14 b15).

temp.

compute chnum=27.

select if bca27 ge 1.

save outfile='C:\VNAS Data\addch27.sav'

/keep qid chnum bca27 to b1527/rename (bca27 to b1527= bca b10 b11 b12 b13 b14 b15).

*merge files of all members.

GET FILE='C:\VNAS Data\addch1.sav'.

ADD FILES /FILE=* /FILE='C:\VNAS Data\addch2.sav'/FILE='C:\VNAS Data\addch3.sav'/FILE='C:\VNAS Data\addch4.sav'

/FILE='C:\VNAS Data\addch5.sav' /FILE='C:\VNASData\addch6.sav'/FILE='C:\VNAS Data\addch7.sav'

/FILE='C:\VNAS Data\addch8.sav' /FILE='C:\VNAS Data\addch9.sav'/FILE='C:\VNAS Data\addch10.sav'

/FILE='C:\VNAS Data\addch11.sav' /FILE='C:\VNAS Data\addch12.sav'/FILE='C:\VNAS Data\addch13.sav'

/FILE='C:\VNAS Data\addch14.sav' /FILE='C:\VNAS Data\addch15.sav'/FILE='C:\VNAS Data\addch16.sav'

/FILE='C:\VNAS Data\addch17.sav'/FILE='C:\VNAS Data\addch18.sav'/FILE='C:\VNAS Data\addch19.sav'

/FILE='C:\VNAS Data\addch20.sav'/FILE='C:\VNAS Data\addch21.sav'/FILE='C:\VNAS Data\addch22.sav'

/FILE='C:\VNAS Data\addch23.sav'/FILE='C:\VNAS Data\addch24.sav'/FILE='C:\VNAS Data\addch25.sav'

/FILE='C:\VNAS Data\addch26.sav'/FILE='C:\VNAS Data\addch27.sav'.

*fre chnum.

var lab chnum child number

/ bca child profile line number

/b10 name of child

/b11 sex

/b12 relationship to respondent

/b13 birth year

/b14 location

/b15 household prolfile line number.

compute childid=(qid*100)+bca.

SORT CASES BY childid(A).

SAVE OUTFILE='C:\VNAS Data\ch_b10b15.sav'.



Số lượt đọc:  1697  -  Cập nhật lần cuối:  23/08/2012 03:43:18 PM