การอนุมานสำหรับข้อมูลเชิงตัวเลขใน R
Mine Cetinkaya-Rundel
Associate Professor of the Practice, Duke University
สมมติว่าในกลุ่มตัวอย่างแบบสุ่ม 100 คน มี 13 คนที่ถนัดซ้าย หากสุ่มตัวอย่างใหม่อีก 100 คน จะแปลกใจไหมถ้าพบแค่ 12 คน? แล้วถ้าเป็น 15? หรือ 30? หรือ 1 หรือ 90?
วิธีวัดความแปรปรวนของค่าเฉลี่ยตัวอย่าง:
จำลองด้วย bootstrapping
ประมาณด้วย Central Limit Theorem
$$ \bar{x} \sim N \left( mean = \mu, SE = \frac{\sigma}{\sqrt{n}} \right) $$
ประมาณค่าเฉลี่ยจำนวนวันที่ชาวอเมริกันทำงานเกินเวลา (ตัวแปร:
moredays) โดยใช้ข้อมูลจาก General Social Survey ปี 2010 (ข้อมูล:gss)
ประมาณค่าเฉลี่ยจำนวนวันที่ชาวอเมริกันทำงานเกินเวลา (ตัวแปร:
moredays) โดยใช้ข้อมูลจาก General Social Survey ปี 2010 (ข้อมูล:gss)
t.test(gss$moredays, conf.level = 0.95)
One Sample t-test
data: gss$moredays
t = 25.628, df = 1146, p-value < 2.2e-16
alternative hypothesis: true mean is not equal to 0
95 percent confidence interval:
5.273367 6.147732
sample estimates:
mean of x
5.710549
การอนุมานสำหรับข้อมูลเชิงตัวเลขใน R