You are on page 1of 10

PHN TCH D LIU BNG PHN MM SPSS 12.

0* PHN 4
Ni dung chnh trong phn ny:

1. 2. 3.

Khai bo cc thng s ca bin To bin gi Hi quy OLS kt hp vi phng php Stepwise

* SPSS 12.0 l sn phm ang k ca SPSS Inc.

1.

Khai bo cc thng s ca cc bin trong b d liu

Khi s dng SPSS 12.0, chng ta thng thy hai Sheet: Data View v Variable View. Data View cha d liu cn Variable View cha cc thng tin ca cc bin trong d liu. Cc thng tin ny bao gm: a. b. c. d. e. f. Name: tn ca bin. Type: loi d liu ca bin. Width: s lng k t hay s lng ch s c hin th. Decimals: s lng ch s thp phn. Label: nhn ca bin. Values: nhn hoc gi tr ca cc quan st trong bin (pht huy tc dng tt trong thng k m t). g. Missing: s lng quan st b khuyt. h. Columns: chiu rng ca ct. i. Align: v tr (nu l s th s l bn phi, cn l k t s nm bn tri) j. Measure: thang o Chi tit cho mt s thng tin quan trng ca bin: a. Name: tn ca bin. Tn bin phi bt u bng mt ch v c di ti a l 64 k t (khng s dng cc k t c bit, khng kt thc tn bin bng du chm .) b. Type: loi d liu ca bin. HNH 1

Nhp vo gc phi ca Type s hin ra cc la chn khc nhau quy nh loi d liu

c.

Measure: thang o

Trong SPSS 12.0 c 3 loi thang o: Scale, Nominal v Ordinal.

Scale: cho bit d liu l nhng con s nh lng (v d: thu nhp, tui, chiu cao ).

Nominal: d liu l ch hoc con s nh tnh (v d: nam, n, hay 0, 1). Ordinal: d liu l ch hoc con s nh tnh nhng ch n th bc, mc cao thp, nng nh (v d: thp, trung bnh, cao; kch lit phn i, phn i, nht tr, nht tr cao). 2. To bin gi

Gi s chng ta c b d liu sau c import t Excel: HNH 2

D liu ny l cc quan st ngu nhin ca mt ca hng bn t v xe ti trong nm. Trong : hieu: tn ca nh sn xut. doanh_thu: doanh thu trong ngy quan st (USD). loai_xe: loi xe t hay xe ti. don_gia: n gi (USD). quy: qu m quan st ri vo.

2.1. To 3 bin gi th hin Qu 1, Qu 2 v Qu 3 Vo Menu Transform, chn Compute HNH 3 t tn quy1 vo Target Variable G s 0 vo y ri bm OK

Ln lt thc hin nh th cho quy2 v quy3. Lc ny trong d liu xut hin bin quy1, quy2 v quy3 vi tt c cc gi tr u bng 0. Tip theo, li tr vo Compute.

HNH 4

Chn 1 bin gi cho qu no a vo Target Variable (quy3 chng hn). Tip theo g s 1 vo ny ri nhn nt If.

HNH 5

Trc tin, chn Include if case satisfies condition

Sau , a bin quy vo ny bng nt ri = 3 Continue

Tr li hp thoi pha trc, tip tc chn OK hon tt to bin gi quy3, v tip tc lm tng t cho quy1 v quy2. 2.2. To bin gi cho loi xe Vo Transform, Recode, Into Different Variables. Tc l chng ta s m ha li bin loai_xe, v s cho ra mt bin mi (nu chn Into Same Variables th SPSS s bin i ri thay th lun thng tin ca bin c).

HNH 6 (1) Chn bin loai_xe a vo ny

(2) t tn bin mi (v d: id_xe)

HNH 7 (3) Change

(4) Old and New Values

(1) G vo ch oto

(2) G vo s 1 hoc 0

r ra hp thoi trc ri OK. Bin gi id_xe s xut hin vi gi tr 0Khi1. gi tr v 2 (3) Add c xc nh th Sau lp li 3 Continue bc cho xe tai. 3 . Hi quy OLS kt hp vi phng php Stepwise L y d liu t file DATA4-6 ca Ramanathan.

HNH 8

By gi chng ta s hi quy OLS kt hp vi phng php Stepwise vi bin ph thuc l POVRATE, bin c lp l tt c cc bin cn li trong d liu.

Tc dng ca phng php Stepwise c hiu nm na l gip chng ta tm ra c nhng kt hp ca cc bin c lp sao cho kt qu hi quy s tt theo hng cc gi tr thng k t , F c ngha, v vic la chn cc kt hp ny s c cn c vo kh nng lm gia tng gi tr ca R2. bt u, vo Menu Analyze, Regression, Linear ri a bin POVRATE v Dependent v cc bin cn li vo Independent(s).

HNH 9

Vo Method, chn Stepwise

Kt qu hi quy c trnh by nh sau: Bng 1: Trnh by thng tin cho bit SPSS tm ra c bao nhiu kt hp tt theo thng k t v F. ng thi, cc m hnh xut hin sau s c gi tr R2 v R2 hiu chnh ln hn m hnh xut hin trc (xem bng 2).
Variables Entered/Removed(a) Variables Entered MEDINC Variables Removed .

Model 1

Method Stepwise (Criteria: Probability-of-F-to-enter <= .050, Probability-of-F-toremove >= .100). Stepwise (Criteria: Probability-of-F-to-enter <= .050, Probability-of-F-toremove >= .100). Stepwise (Criteria: Probability-of-F-to-enter <= .050, Probability-of-F-toremove >= .100). Stepwise (Criteria: Probability-of-F-to-enter <= .050, Probability-of-F-toremove >= .100).

2 3 4

HIGHSCHL FAMSIZE COLLEGE

. . .

a Dependent Variable: POVRATE

Bng 2:
Model Summary

Model 1 2 3 4 a b c d

R .782(a) .895(b)

R Square .612 .800

Adjusted R Square .605 .793

Std. Error of the Estimate 2.4870 1.7999

.903(c) 1.7445 .816 .805 .912(d) 1.6870 .831 .818 Predictors: (Constant), MEDINC Predictors: (Constant), MEDINC, HIGHSCHL Predictors: (Constant), MEDINC, HIGHSCHL, FAMSIZE Predictors: (Constant), MEDINC, HIGHSCHL, FAMSIZE, COLLEGE

Bng 3:
ANOVA(e) Sum of Squares Regression Residual Total 2 Regression Residual Total Regression Residual Total Regression Residual 545.424 346.376 891.799 713.626 178.173 891.799 727.461 164.338 891.799 740.961 150.838

Model 1

df 1 56 57 2 55 57 3 54 57 4 53

Mean Square 545.424 6.185 356.813 3.240 242.487 3.043 185.240 2.846

F 88.181

Sig. .000(a)

110.144

.000(b)

79.679

.000(c)

65.088

.000(d)

a b c d e

Total 891.799 57 Predictors: (Constant), MEDINC Predictors: (Constant), MEDINC, HIGHSCHL Predictors: (Constant), MEDINC, HIGHSCHL, FAMSIZE Predictors: (Constant), MEDINC, HIGHSCHL, FAMSIZE, COLLEGE Dependent Variable: POVRATE

Bng 4: Cc h s hi quy v thng k t


Coefficients(a) Unstandardized Coefficients B 23.131 -.374 41.849 -.435 -.288 31.775 -.421 -.235 2.434 19.172 -.552 -.139 5.414 .195 Std. Error 1.446 .040 2.801 .030 .040 5.449 .030 .046 1.141 7.826 .067 .063 1.758 .090 Standardized Coefficients Beta 15.997 -.782 -.909 -.452 -.880 -.369 .148 -1.154 -.218 .329 .380 -9.390 14.943 -14.475 -7.206 5.831 -14.131 -5.111 2.132 2.450 -8.284 -2.214 3.079 2.178 .000 .000 .000 .000 .000 .000 .000 .000 .038 .018 .000 .031 .003 .034

Model

Sig.

1 2 3

(Constant) MEDINC (Constant) MEDINC HIGHSCHL (Constant) MEDINC HIGHSCHL FAMSIZE (Constant) MEDINC HIGHSCHL FAMSIZE COLLEGE

a Dependent Variable: POVRATE

Bng 5: Cc bin b b ra trong qu trnh chy hi quy


Excluded Variables(e) Partial Correlation Collinearity Statistics

Model

Beta In

Sig.

COLLEGE FAMSIZE HIGHSCHL UNEMP URB

.157(a) .339(a) -.452(a) .342(a) -.094(a) -.038(b) .148(b) .071(b) -.010(b) .380(c) -.055(c) -.114(c) .025(d) -.091(d)

.998 4.809 -7.206 3.082 -1.133 -.324 2.132 .733 -.155 2.178 -.485 -1.620 .212 -1.296

.323 .000 .000 .003 .262 .747 .038 .467 .878 .034 .630 .111 .833 .201

.133 .544 -.697 .384 -.151 -.044 .279 .099 -.021 .287 -.066 -.217 .029 -.177

Tolerance .281 .999 .921 .490 .993 .266 .708 .386 .955 .105 .270 .666 .242 .645

COLLEGE FAMSIZE UNEMP URB COLLEGE UNEMP URB UNEMP URB

a b c d e

Predictors in the Model: (Constant), MEDINC Predictors in the Model: (Constant), MEDINC, HIGHSCHL Predictors in the Model: (Constant), MEDINC, HIGHSCHL, FAMSIZE Predictors in the Model: (Constant), MEDINC, HIGHSCHL, FAMSIZE, COLLEGE Dependent Variable: POVRATE

Tuy nhin, vic la chn m hnh thch hp cho nghin cu cn ph thuc vo nhiu yu t khc na, phng php Stepwise ch l mt cch gip c th chng ta tit kim thi gian hay gi ra mt tng v vic kt hp cc bin c lp trong qu trnh hi quy. Nu nh chng ta cha nm vng v hi quy bi th s khng pht huy c tin ch ca phng php ny.

11