You are on page 1of 20

I HC QUC GIA THNH PH H CH MINH

TRNG I HC BCH KHOA


***********

BO CO: BI TP LN

XC SUT THNG K

GVHD: PGS.TS NGUYN NH HUY


SV:
NGUYN VN HU
MSSV: 20901139
NHM: 04
S 4

TP.H CH MINH , THNG 11 NM 2010


1

BI 1
A. V d 3.4/161 SGK
Hiu sut phn trm (%) ca mt phn ng ha hc c nghin cu theo ba yu t: pH (A),
nhit (B) v cht xc tc (C) c trnh by trong bng sau:
Yu t B

Yu t A

B1

B2

B3

B4

A1

C1

C2

14

C3

16

C4

12

A2

C2

12

C3

15

C4

12

C1

10

A3

C3

13

C4

14

C1

11

C2

14

A4

C4

10

C1

11

C2

13

C3

13

Hy nh gi v nh hng ca cc yu t trn n hiu sut phn ng?


Phng php: PHN TCH PHNG SAI BA NHN T
S phn tch ny c dng nh gi v s nh hng ca ba yu t trn cc gi tr quan st
G (i = 1, 2... r: yu t A; j = 1, 2...r: yu t B; k = 1, 2...r: yu t C).
M hnh:
Khi nghin cu nh hng ca hai yu t, mi yu t c n mc, th ngi ta dng m hnh vung
la tinh nn. V d nh m hnh vung la tinh 44:
B

M hnh vung la tinh ba yu t c trnh by nh sau:


Yu t B

Yu t
A

B1

B2

B3

B4

A1

C1

Y111

C2

Y122

C3

Y133

C4

Y144

T1..

A2

C2

Y212

C3

Y223

C4

Y234

C1

Y241

T2..

A3

C3

Y313

C4

Y324

C1

Y331

C2

Y342

T3..

A4

C4

Y414

C1

Y421

C2

Y432

C3

Y443

T4..

T.i.

T.1.

T.2.

T.3.

T.4.
2

Bng ANOVA:
Ngun sai s

Tng s bnh
phng

Bc t do

Yu t A

(r-1)

Ti..2 T...
2
SSR=
r
i =1 r

(r-1)

SSC=

(Hng)
Yu t B

(Ct)

Bnh phng trung


bnh

j =1

T. 2j .
r

T...
r2

(r-1)

Sai s

(r-1)(r-2)

Tng cng

(r2-1)

SSR
(r 1)

FR=

MSR
MSE

MSC=

SSC
(r 1)

FC=

MSC
MSE

MSF=

SSF
(r 1)

F=

MSF
MSE

T..2k T...
2
r
k =1 r
r

SSF=

Yu t C

MSR=
2

SSE=SST

Gi tr thng k

MSE=

(SSF+SSR+SSC)

SSE
(r 1)(r 2)

T...2
SST= Y 2
r
2
ijk

Trc nghim

Gi thit:
H0: 1 = 2 = ...= k Cc gi tr trung bnh bng nhau
H1: i j

C t nht hai gi tr trung bnh khc nhau

Gi tr thng k: FR, FC, F

Bin lun

Nu FR < F(r-1)(r-2)

Chp nhn H0 i vi yu t A

Nu FC < F(r-1)(r-2)

Chp nhn H0 i vi yu t B

Nu F < F(r-1)(r-2)

Chp nhn H0 i vi yu t C

Bi lm:
 Nhp d liu vo bng tnh

 Thit lp cc biu thc v tnh cc gi tr thng k


1. Tnh cc gi tr Ti.., T.j., T..k v T...
Cc gi tr Ti..
Chn B7 v chn biu thc =SUM(B2:E2)
Chn C7 v nhp biu thc =SUM(B3:E3)
Chn D7 v nhp biu thc =SUM(B4:E4)
Chn E7 v nhp biu thc =SUM(B4:E4)

Cc gi tr T.j.

Chn B8 v nhp biu thc =SUM(B2:B5)


Dng con tr ko k hiu t in t B8 n E8

Cc gi tr T..k

Chn B9 v nhp biu thc =SUM(B2,C5,D4,E3)


Chn C9 v nhp biu thc =SUM(B3,C2,D5,E4)
Chn D9 v nhp biu thc =SUM(B4,C3,D2,E5)
Chn E9 v nhp biu thc =SUM(B5,C4,D3,E2)

Gi tr T

Chn B10 v nhp biu thc=SUM(B2:E5)


2. Tnh cc gi tr G
Chn G7 v nhp biu thc =SUMSQ(B7:E7)
Dng con tr ko k hiu t in t G7 n G9
Chn G10 v nhp biu thc =POWER(B10,2)
Chn G11 v nhp biu thc =SUMSQ(B2:E5)
3. Tnh cc gi tr SSR, SSC, SSF, SST v SSE
Cc gi tr SSR, SSC, SSF
Chn I7 v nhp biu thc =G7/4-39601/POWER(4,2)
Dng con tr ko k hiu t in t I7 n I9

Gi tr SST

Chn I11 v nhp biu thc =G11-G10/POWER(4,2)

Gi tr SSE

Chn I10 v nhp biu thc =I11-SUM(I7:I9)


4. Tnh cc gi tr MSR, MSC, MSF v MSE
Gi tr MSR, MSC, MSF
Chn K7 v nhp biu thc =I7/(4-1)
Dung con tr ko k hiu t in t K7 n K9
4

Gi tr MSE: Chn K10 v nhp biu thc =I10/((4-1)*(4-2))


Tnh cc gi tr F:

Chn M7 v nhp biu thc =K7/$K$10


Dng con tr ko k hiu t in t M7 n M9.

Kt qu v bin lun
FR=3.11 < F0.05(3,6)=4.76

=> chp nhn H0 (pH)

FC=11.95 > F0.05(3,6)=4.76

=> bc b H0 (nhit )

F=30.05 > F0.05(3,6)=4.76

=> bc b H0 (cht xc tc)

Vy ch c nhit v cht xc tc gy nh hng n hiu sut phn ng.


B. V d 4.2/170 SGK
Ngi ta dng ba mc nhit gm 105, 120 v 135C kt hp vi ba khong thi gian l 15,
30 v 60 pht thc hin mt phn ng tng hp. Cc hiu sut ca phn ng (%) c trnh
by trong bng sau:
Thi gian (pht)

Nhit (C)

Hiu sut (%)

X1

X2

15

105

1.87

30

105

2.02

60

105

3.28

15

120

3.05

30

120

4.07

60

120

5.54

15

135

5.03

30

135

6.45

60

135

7.26
5

Hy cho bit yu t nhit v thi gian/hoc yu t thi gian c lin quan tuyn tnh vi hiu
sut ca phn ng tng hp? Nu c th iu kin nhit 115C trong vng 50 pht th hiu
sut phn ng s l bao nhiu?
Phng php: HI QUY TUYN TNH A THAM S
Trong phng trnh hi quy tuyn tnh a tham s, bin s ph thuc Y c lin quan n k bin
s c lp Xi (i=1,2,...,k) thay v ch c mt nh trong hi quy tuyn tnh n gin.
Phng trnh tng qut

x0,x1,...,xk = B0 + B1X1 + ... + BkXk


Bng ANOVA
Ngun sai s

Bc t do

Tng s bnh phng

Hi quy

SSR

Sai s

N-k-1

SSE

Tng cng

N-1

SST = SSR + SSE

Bnh phng trung


bnh
MSR=
MSE =

SSR
k

Gi tr thng
k
F=

MSR
MSE

SSE
( N k 1)

Gi tr thng k
Gi tr R-bnh phng:

R2 =

SSR
kF
=
( R 2 0.81 l kh tt)
SST ( N k 1) + kF

lch chun:
SSE
( S 0.30 l kh tt)
( N k 1)

S=

Trc nghim

Gi tr thng k: F

Trc nghim t:
H0: i = 0 Cc h s hi quy khng c ngha.
H1: i 0 C t nht vi h s hi quy c ngha.

F < t (r-1)(r-2) Chp nhn H0


2

Trc nghim F

H0: i = 0 Phng trnh hi quy khng thch hp.


6

H1 : i 0

Phng trnh hi quy thch hp vi t nht vi h s Bi.

F < F(1,N-k-1) Chp nhn H0

Bi lm:
 Nhp d liu vo bng tnh
D liu nht thit phi c nhp theo ct.

 p dng Regression
Nhn ln lt n lnh Tools v lnh Data Analysis
Chn chng trnh Regression trong hp thoi Data Analysis ri nhp OK

Trong hp thoi Regression, ln lt n nh cc chi tit:

Phm vi ca bin s Y (input Y range)

Phm vi ca bin s X (input X range)

Nhn d liu (Labels)

Mc tin cy (Confidence level)

Ta u ra (Output range)

ng hi quy (Line Fit Plots),

Cc gi tr u ra cho bng sau:


Phng trnh hi quy:

x1=f(X1)

x1=2.73 + 0.04X1 (R2=0.21, S=1.81)

t0=2.19 < t0.05 = 2.365 (hay Pv2=0.071>=0.05)

=> Chp nhn gi thit H0

t1=1.38 < t0.05 = 2.365 (hay Pv=0.209>=0.05)

=> Chp nhn gi thit H0

F=1.95 < F0.05 = 5.590 (hay Fs=0.209>=0.05)

=> Chp nhn gi thit H0

Vy c hai h s 2.73 (B0) v 0.04 (B1) ca phng trnh hi quy x1 = 2.73 + 0.04X1 u khng
c ngha thng k. Ni cch khc phng trnh hi quy ny khng thch hp.

Phng trnh hi quy: x2 = f(X2)

x2 = -11.141 + 0.129X2 (R2=0.76,S=0.99)

10

t0 = 3.418 > t0.05 = 2.365 (hay Pv2=0.011 > =0.05) =>Bc b gi thit H0
t1= 4.757 > t0.05 = 2.365(hay Pv=0.00206 < =0.05) =>Bc b gi thit H0
F= 22.631 > F=5.590(hay Fs=0.00206 < =0.05)

=>Bc b gi thit H0

Vy c hai h s -11.141 (B0) v 0.129 (B1) ca phng trnh hi quy x2= -11.141 + 0.129X2
u c ngha thng k. Ni cch khc phng trnh hi quy ny thch hp.

Kt lun: yu t nhit c lin quan tuyn tnh vi hiu sut ca phn ng tng hp.
Phng trnh hi quy: x1,x2=f(X1,X2)
x1,x2 = -12.70 + 0.04X1 + 0.13X2 (R2=0.97; S=0.33)

11

t0=11.528 > t0.05=2.365 (hay Pv2=2.260.10-5<=0.05)=>Bc b gi thit H0


t1=7.583 > t0.05=2.365 (hay Pv=0.00027<=0.05)
-5

F=131.392 > 5.14 (hay Fs=1.112*10 <=0.05)

=>Bc b gi thit H0
=>Bc b gi thit H0

Vy c hai h s -12.70 (B0), 0.04 (B1) v 0.13 (B1) ca phng trnh hi quy x1,x2 =-12.7 +
0.04X1 + 0.13X2 u c ngha thng k. Ni cch khc, phng trnh hi quy ny thch hp.

Kt lun: Hiu sut ca phn ng tng hp c lin quan tuyn tnh vi c hai yu t l thi
gian v nhit .

S tuyn tnh ca phng trnh x1,x2 = -12.70 + 0.04X1 + 0.13X2. C th c trnh by trong
biu phn tn (scatter plots):

12

Biu phn tn

8
7
6
5
Y d
4
on
3
2
1
0
0

Nu mun d on hiu sut bng phng trnh hi quy Y= -12.70 + 0.04X1 + 0.13X2
ch cn chn mt , v d nh:B31, sau nhp hm=B28+B29*50+EB30*115 v c kt qu
nh sau:

Vy hiu sut phn ng theo


d on 115C trong vng
50 pht l 4.3109%.

13

Bi 2: Hai my cng gia cng mt loi chi tit. Ngi ta mun kim tra xem hai my ny c
chnh xc nh nhau hay khng? lm iu ngi ta ly ngu nhin t mi my 7 chi tit,
em o v thu c kt qu sau:
My A

135

138

136

140

138

135

139

My B

140

135

140

138

135

138

140

Vi mc ngha 0.05 c th cho rng hai my ny c chnh xc nh nhau hay khng?


Bit kch thc chi tit c phn phi chun.

Phng php: so snh phng sai


Nhp d liu vo bng tnh:

p dng F-Test Two-Sample for Variances

14

Kt qu v bin lun:
H 0 : A2 = B2 Hai my c chnh xc
nh nhau.
H t : A2 < B2 chnh xc ca my A
cao hn my B
F = 0.233 < F0.05 = 0.781 Bc b gi
thit H0
Vy chnh xc ca my A cao hn
my B

BI 3:
Mt ca hng ln c bn ba loi giy A,B,C. Theo di s khch hng mua cc loi giy ny
trong 5 ngy, ngi qun l thu c bng s liu sau:

A
28
21
20
18
23

Loi giy
B
35
42
32
25
27

C
33
38
31
42
29

Vi mc ngha =1% hy so snh lng tiu th trung bnh ca ba loi giy ni trn.

Bi lm:
y l bi ton phn tch phng sai mt yu t, mc tiu th nh hng bi loi giy
Gi thit H0: 1 = 2 = 3; tc lng tiu th trung bnh l bng nhau


Nhp d liu vo bng tnh

 p dng Anova: Single Factor


Nhn ln lt n lnh Tools v lnh Data Analysis.
Chn trng trnh Anova: Single Factor trong hp thoi Data Analysis ri nhn nt OK
Trong hp thoi Anova: single factor ln lt n nh
Phm vi u vo(input range)

15

Cch xp xp theo hang hay ct(group by)


Nhn d liu(labels in fisrt row/column)
Phm vi u ra(output range)

Sau khi nhn OK xut hin bng Anova:

Kt lun:
T gi tr trong bng Anova:
F = 7.5864 > F0.01 = 6.9266 => Bc b H0
=> Lng tiu th ca 3 loi giy trn l khc nhau
Lng tiu th trung bnh ca loi giy A l 22
Lng tiu th trung bnh ca loi giy B l 32.2
Lng tiu th trung bnh ca loi giy C l 34.6
=> Lng tiu th trung bnh: Loi C > Loi B > loi A


16

Cu 4: Vi mc ngha 0.03 hy phn tch vai tr ngnh ngh (chnh, ph) trong hot
ng kinh t ca cc h gia nh mt vng nng thn trn c s bng s liu v thu
nhp trung bnh ca mt h tng ng vi cc ngnh ngh ni trn nh sau:

Ngh chnh

Ngh ph
(1)

(2)

(3)

(4)

Trng la (1)

3.5

7.4

8.0

3.5

Trng cy n tri (2)

5.6

4.1

6.1

9.6

Chn nui(3)

4.1

2.5

1.8

2.1

Dch v (4)

7.2

3.2

2.2

1.5

1.C s l thuyt: y l dng ton phn tch phng sai hai yu t (khng lp):
Gi thit: H0 cc gi tr trung bnh l bng nhau
i gi thit: H1 cc gi tr trung bnh l khng bng nhau.
Nhp d liu vo my tnh:

p dng: Anova: Two Factor without Replication


a)Ti nhm lnh Data analysis, chn Anova:Two Factor without Replication.
b)Trong hp thoi Anova:Two Factor without Replication, ln lt n nh cc gi tr:
- Phm vi u vo (input range): chn bng tnh ta va to.
-Nhn d liu (labels in first row/column)
-Ngng tin cy: Alpha = 3% = 0.03
-Phm vi u ra (output Range).

17

Sau khi click Ok th kt qu thu c nh sau:

FR = 1.9966 < F0.03 = 4.7407 => chp nhn gi thit H0 (ngh chnh).
FC = 0.1106 < F0.03 = 4.7407 => chp nhn gi thit H0 (ngh ph).
Vy, thu nhp ca gia nh ging nhau xt cho ngh chnh hay ngh ph.

18

Bi 5: Vi mc ngha 0.02 hy phn tch s bin ng ca thu nhp ($/thng/ngi)


trn c s s liu iu tra v thu nhp trung bnh ca 4 loi ngnh ngh 4 ku vc khc
nhau sau y:
Loi ngnh
ngh

Ni lm vic

V1

V2

V3

V4

1
2
3
4

212
222
241
240

200
205
250
228

230
222
245
230

220
225
235
240

Bi lm:
Phng php: phn tch phng sai hai yu t khng lp
Nhp d liu vo bng tnh:

p dng: Anova: Two Factor without Replication


a)Ti nhm lnh Data analysis, chn Anova:Two Factor without Replication.
b)Trong hp thoi Anova: Two Factor without Replication, ln lt n nh cc gi tr:
- Phm vi u vo (Input Range): chn bng tnh ta va to.
-Nhn d liu (labels in first row/column)
-Ngng tin cy: Alpha = 2% = 0.02
-Phm vi u ra (Output Range).

19

Sau khi click Ok th kt qu thu c nh sau:

FR = 8.7831 > F0.02 = 5.5097 => bc b gi thit H0 (loi ngnh ngh).


FC = 1.2328 < F0.02 = 5.5097 => chp nhn gi thit H0 (ni lm vic).
Vy ch c loi ngnh ngh nh hng n thu nhp trung bnh trn thng ca mt ngi.

20