R တွင် f test လုပ်နည်း
လူဦးရေကွဲလွဲမှုနှစ်ခု တူညီမှုရှိမရှိ စမ်းသပ်ရန် F test ကို အသုံးပြုသည်။ စမ်းသပ်မှု၏ null နှင့် အခြားအခြားသော ယူဆချက်များမှာ အောက်ပါအတိုင်းဖြစ်သည် ။
H 0 : σ 1 2 = σ 2 2 (လူဦးရေကွဲလွဲမှု ညီမျှသည်)
H 1 : σ 1 2 ≠ σ 2 2 (လူဦးရေကွဲလွဲမှု မညီမျှ ပါ)
R တွင် F-test ကိုလုပ်ဆောင်ရန်၊ သင်သည် အောက်ပါ syntax များထဲမှ တစ်ခုနှင့် var.test() လုပ်ဆောင်ချက်ကို အသုံးပြုနိုင်သည်။
- နည်းလမ်း 1- var.test(x၊ y၊ အစားထိုး = “နှစ်ဖက်”)
- နည်းလမ်း 2- var.test(တန်ဖိုးများ ~ အုပ်စုများ၊ ဒေတာ၊ အစားထိုး = “နှစ်ဖက်”)
အစားထိုး အသုံးပြုရန် အခြားယူဆချက်အား ညွှန်ပြသည်ကို သတိပြုပါ။ မူရင်းမှာ “ နှစ်ဘက်” ဖြစ်သော်လည်း၊ “ ဘယ်” သို့မဟုတ် “ ညာ” အဖြစ် သတ်မှတ်နိုင်သည်။
ဤသင်ခန်းစာသည် နည်းလမ်းနှစ်ခုလုံးကို အသုံးပြု၍ R တွင် F test ကို မည်သို့လုပ်ဆောင်ရမည်ကို ရှင်းပြထားသည်။
နည်းလမ်း 1- R တွင် F စစ်ဆေးမှု
အောက်ပါကုဒ်သည် ပထမနည်းလမ်းကို အသုံးပြု၍ F test ပြုလုပ်နည်းကို ပြသသည်-
#define the two groups x <- c(18, 19, 22, 25, 27, 28, 41, 45, 51, 55) y <- c(14, 15, 15, 17, 18, 22, 25, 25, 27, 34) #perform an F-test to determine in the variances are equal var.test(x, y) F test to compare two variances data: x and y F = 4.3871, num df = 9, denom df = 9, p-value = 0.03825 alternative hypothesis: true ratio of variances is not equal to 1 95 percent confidence interval: 1.089699 17.662528 sample estimates: ratio of variances 4.387122
F-test statistic သည် 4.3871 ဖြစ်ပြီး သက်ဆိုင်ရာ p-value သည် 0.03825 ဖြစ်သည်။ ဤ p-value သည် 0.05 ထက်နည်းသောကြောင့်၊ null hypothesis ကို ငြင်းပယ်ပါမည်။ ဆိုလိုသည်မှာ လူဦးရေကွဲလွဲမှု နှစ်ခုသည် မညီဟု ဆိုရန် လုံလောက်သော အထောက်အထားရှိသည်။
နည်းလမ်း 2- R တွင် F စစ်ဆေးမှု
အောက်ပါကုဒ်သည် ပထမနည်းလမ်းကို အသုံးပြု၍ F test ပြုလုပ်နည်းကို ပြသသည်-
#define the two groups data <- data.frame(values=c(18, 19, 22, 25, 27, 28, 41, 45, 51, 55, 14, 15, 15, 17, 18, 22, 25, 25, 27, 34), group= rep (c('A', 'B'), each = 10 )) #perform an F-test to determine in the variances are equal var.test(values~group, data=data) F test to compare two variances data: x and y F = 4.3871, num df = 9, denom df = 9, p-value = 0.03825 alternative hypothesis: true ratio of variances is not equal to 1 95 percent confidence interval: 1.089699 17.662528 sample estimates: ratio of variances 4.387122
တစ်ဖန် F-test statistic သည် 4.3871 ဖြစ်ပြီး သက်ဆိုင်ရာ p-value သည် 0.03825 ဖြစ်သည်။ ဤ p-value သည် 0.05 ထက်နည်းသောကြောင့်၊ null hypothesis ကို ငြင်းပယ်ပါမည်။
ဆိုလိုသည်မှာ လူဦးရေကွဲလွဲမှု နှစ်ခုသည် မညီဟု ဆိုရန် လုံလောက်သော အထောက်အထားရှိသည်။
ဆက်စပ် : ဤအခမဲ့ တူညီသော ကွဲပြားမှုများ F-test ဂဏန်းတွက်စက်ကို အသုံးပြု၍ F-test ပြုလုပ်ပါ။
F test ကို ဘယ်အချိန်မှာ သုံးမလဲ။
F-test ကို အောက်ပါမေးခွန်းများထဲမှ တစ်ခုကို ဖြေဆိုရန် ပုံမှန်အားဖြင့် အသုံးပြုသည်-
1. နမူနာနှစ်ခုသည် တူညီသောကွဲလွဲမှုများရှိသော လူဦးရေများမှ လာပါသလား။
2. ကုသမှုအသစ် သို့မဟုတ် လုပ်ငန်းစဉ်သည် လက်ရှိကုသမှု သို့မဟုတ် လုပ်ငန်းစဉ်၏ ကွဲပြားမှုကို လျှော့ချနိုင်ပါသလား ။
ထပ်လောင်းအရင်းအမြစ်များ
Python တွင် F test ပြုလုပ်နည်း
ဆုတ်ယုတ်မှုတွင် အလုံးစုံအရေးပါမှုအတွက် F စစ်ဆေးမှုအား မည်သို့အဓိပ္ပာယ်ဖွင့်ဆိုမည်နည်း။