2. Overview
• INFERENTIAL statistics is the branch of statistics that allow us
to draw conclusions about the data or to test hypothesizes.
“Statistical inference is the act of reaching conclusions
about the world based on a set of data, and then
evaluating the reliability of those conclusions.”
! ! สถิติอางอิงเปนวิธีการในการแกปญหาที่จะพยายาม อาง (infer)
คุณสมบัติของกลุมขอมูลจากกลุมตัวอยางไปยังประชากร
! ! จุดหมายของสถิติอางอิงมีจุดหมายเพื่อทำนายหรือประมาณ
ลักษณะของประชากรจากขอมูลลักษณะของกลุมตัวอยาง และ
ประเมินความนาเชื่อถือของผล
4. Z - test
T – test
F – test
χ2 test
rxy
ทดสอบคาเฉลี่ยของกลุมตัวอยางเปรียบเทียบกับกลุม
ประชากรเมื่อกลุมตัวอยางมีขนาดเกิน 30
เปรียบเทียบคาเฉลี่ยของกลุมตัวอยาง 2 กลุม เมื่อกลุม
ตัวอยางมีขนาดไมเกิน 30
เปรียบเทียบคาเฉลี่ยของกลุมตัวอยาง 3 กลุมขึ้นไป
ทดสอบความเปนอิสระตอกัน ระหวางคุณลักษณะของขอมูล
ที่เปนจำนวนหรือความถี่
ทดสอบความสัมพันธระหวางคุณลักษณะของขอมูลที่เปน
ระดับชวงหรือสัดสวน
สถิติอางอิงที่ที่ใชในการหาขอสรุปจากกลุมตัวอยาง
5. Confidence Intervals
• Central Limit Theorem:
• หมายถึง กลุมตัวอยางจะกระจายตัวอยูจาก sample mean ในรูปของโคง
ปกติ Normal curve ("N") ที่มีคา mean เทากับคา true mean (mu)
และ standard deviation เทากับ “standard error” (sigma หาร
ดวย square root of n, โดย n เปนจำนวนกลุมตัวอยาง (sample size))
ดังนั้น standard deviation ของการกระจายตัวของกลุมตัวอยางเปน
ตัวแปรจาก sample size.
7. “Z-values”
• คา “z-value” หรือ “คามาตรฐาน” เปนคะแนนที่แปลงรูปมาจากคะแนนดิบ
เพื่อใหมีความหมายชัดเจนยิ่งขึ้น โดยทั่วไปการแปลงคะแนนดิบใหเปน
คะแนนมาตรฐาน
• เปนการแปลงคะแนนดิบใหเปนคะแนน มาตรฐานโดยอาศัยวิธีการทางสถิติ
และรักษาโคงการแจกแจงเดิมไวไมเปลี่ยนแปลง
• การคานวณหาคะแนนมาตรฐาน Z อาศัยคะแนนเฉลี่ยละคาเบี่ยงเบน
มาตรฐานของ คะแนนแตละชุด โดยใชสูตรดังนี้สูตร
(X-X)/SD
• เมื่อ Z แทน คะแนนมาตรฐานของแตละคน
• X แทนคะแนนดิบของแตละคน
• X แทน คะแนนเฉลี่ยของขอมูลในแตละชั้น
• SD แทน ความเบี่ยงเบนมาตรฐานของคะแนนชุดนั้น
8.
9. การคำนวณคา “Critical Values”
• By definition: α = 1 - p or p = 1 - α
• Thus if we want to find the central 95 percent of a standard normal curve,
we define p = 0.95 and α = 0.05
• If we define p = 0.95 and hence α = 0.05, we want 95 percent of the
probability to be within our area, and 5 percent to be outside.
• Since a normal curve is symmetrical, having 5 percent of the value in the
tails means having 2.5 percent of the value in each tale. That is, we just
take the value of alpha and divided by 2 for each of the value points.
• จำกัดความโดย: α = 1 - p or p = 1 - α
• ดังนั้นถาเราตองการหาพื้นที่ 95 เปอรเซ็นต ตรงกลางของ standard normal curve เรา
กำหนดคา p = 0.95 และ α = 0.05
• ถากำหนด p = 0.95 จะไดคา α = 0.05 เมื่อเราตองการหาความเปนไปไดที่ 95
เปอรเซ็นตของประชากรที่อยูตรงกลาง โดยมี 5 เปอรเซ็นตอยูนอกขอบเขต.
• จาก normal curve ที่สมมาตร 5 เปอรเซ็นตของประชากรที่อยูนอกขอบเขต จะได 2.5
เปอรเซ็นตที่อยูที่หางของ normal curve แตละดาน.
10. Confidence Intervals
• เมื่อพิจารณาหางของโคงปกติสองหาง “two-sided” เปนการพิจารณา
percent ของการกระจายตัวระหวางคา 2 คา นั่นเปนการกำหนด
CONFIDENCE INTERVAL.
• ดังนั้นถาเราสนใจคา CONFIDENCE INTERVAL จากคา true mean (μ)
เราสามารถอธิบายดวยสมการดังนี้:
The Probability
that the mean
is between these 2 values
is 1-alpha
11. Sample Sizes and Confidence Intervals
• KEY POINT: As the sample size increases, the interval (in
which we are p percent “confident” that the true sample
mean lies) gets thinner and thinner. CONFIDENCE INTERVALS
ARE SAMPLE SIZE DEPENDENT!
12. Confidence Intervals
• ชวงความมั่นใจ (confidence interval) 95 percent หมายถึงอะไร?
หมายถึงถาเราคำนวณคาเฉลี่ยของกลุมตัวอยาง sample average
เปนการประมาณการคา true population mean จำนวน100 ครั้ง เรามี
ความมั่นใจวา 95 ครั้งจาก 100 ครั้ง เราจะสามารถไดคาเดียวกับ true
value of μ (“true” population mean)
• เราใชความรูทางสถิตินี้ในการแสดงความมั่นใจวาเราประมาณคาของ
ประชากรไดอยางมีความแมนยำ โดยไมตองทำการทดสอบกลุมตัวอยาง 100
ครั้ง!
17. Normal Distribution
• โคงระฆังคว่ำ หรือที่เรียกวา Normal Curve หรือ Gaussian
Curve (ตามชื่อของนักวิทยาศาสตรชาวเยอรมัน Karl
Friedrick Gauss, 1777-1855)
18. Standard Normal Distribution
• การกระจายตัวแบบ Normal มีคาเรียกวา Z value
• เปนการกระจายตัวจากคาเฉลี่ยกลาง ที่
โดยหางจากคากลางตามคา Standard Deviation
เชน คา Z = 1.5 หมายถึง จุดที่หางจากคากลาง 1.5 หนวย
ของ Standard Deviation
• Each Z value is the number of standard deviations
away from the mean.
!
€
µ = 0
!
€
σ =1
25. • The critical value X = 74 differs from its
mean = 69 and = 3.
Z Value
!
€
Z =
X − µ
σ
!
€
µ !
€
σ
!
Z =
74 − 69
3
=
5
3
=1.67
• Pr(Z>1.67) = 0.47 = 5%
26. Example
• Suppose the yearling trout in a lake have
lengths that are approximately normally
distributed, about a mean = 9.5” with a
standard deviation = 1.4”. What
proportion of them:
a. Exceeding 12” (the length for keeping a
catch)?
b. Exceeding 10” (the newly proposed legal
length)?
!
€
µ
!
€
σ
27. !
€
Z =
X − µ
σ
!
€
Z =
12.0 − 9.5
1.4
=
2.5
1.4
=1.79
Thus
Pr(X>12) = Pr(Z>1.79)
= 0.037 = 4%
a.
28. !
€
Z =
X − µ
σ
Thus
Pr(X>10) = Pr(Z>0.36)
= 0.359 = 36%
b.
!
€
Z =
10.0 − 9.5
1.4
=
0.5
1.4
= 0.36
Z=0.36
30. CORRELATION and REGRESSION.
• Correlation: correlation measures the strength of
the relationship between variables or the degree
to which two variables are correlated (co-
related). Another way to think of it is that is a
measure of the extent to which two variables
"move together" – as one changes, how does the
other one change? The correlation measure is a
"dimensonless" number, and can therefore be
used to compare "apples" and "oranges" or
variables measured in different units.
32. CORRELATION and REGRESSION.
• ถา | r | มีคามาก หมายถึง x และ y มีความสัมพันธกันมาก
• r = 0 หมายถึง x และ y ไมมีความสัมพันธกัน
• r > 0 หมายถึง x มีคาเพิ่มขึ้น แลว y จะมีคาเพิ่มขึ้น หรือ ถา x
มีคาลดลงแลว y จะมีคาลดลง
• r < 0 หมายถึง x มีคาเพิ่มขึ้น แลว y จะมีคาลดลง หรือ ถา x มี
คาลดลงแลว y จะมีคาเพิ่มขึ้น
• คา b และ r จะมีเครื่องหมายเหมือนกัน
33. REGRESSION.
• What is a regression? Informally, it is a line fitted between two
variables to estimate the (linear) relationship between the two
variables. In the case where we have more than one "predictor"
variable, it is multi-dimensional plane describing the relationship
between the variables.
• One way to think about regression is that it is a way to test the
statistical effect of one variable on another variable, holding all
other variables constant.
• เปนการหาความสัมพันธเชิงเสนตรงระหวางตัวแปรสองตัว ในกรณีที่มี
ตัวแปรตนมากกวา 1 ตัวแปร ความสัมพันธจะเปนระนาบหลายมิติ
• ความสัมพันธเชิงเสนบอกอิทธิพลเฉพาะของตัวแปรตนตอตัวแปรตาม
เพียงคูเดียว โดยไมคำนึงถึงตัวแปรอื่น (ถือวาคงที่)
34. เดือน 1 2 3 4 5 6 7 8 9 10 11 12
อุณหภูมิ 18 24 33 37 34 28 32 27 28 27 21 19
ผูชุมนุม 43 38 32 37 5 0 0 0 0 8 23 49
ใชอธิบายความสัมพันธระหวางขอมูล 2 ชุดที่มีอิทธิพลตอกัน (regression) และ
ขอมูล 2 ชุดที่มีความเกี่ยวพันกัน (correlation)
ใช สมการ y = a + bx
โดย Y y = เสนการถดถอย คำนวณไดจากทุกคาของ x ที่กำหนดให Y
Y a = จุดตัดบนแกน y (Intercept)
Y b = ความชันบนเสนกราฟ หรือสัมประสิทธการถดถอย (Regression Coefficient)
ตัวอยางขอมูล
x = ตัวแปรอิสระ (Independent Variable)
y = ตัวแปรตาม (Dependent Variable)
CORRELATION and REGRESSION.
35. CORRELATION and REGRESSION.
X Variable 1 Line Fit Plot
0
10
20
30
40
50
60
0 10 20 30 40
X Variable 1
Y
Y
Predicted Y