高校数学の質問スレ(医者・東大卒専用) Part438 (991レス)
前次1-
抽出解除 必死チェッカー(本家) (べ) 自ID レス栞 あぼーん

803
(1): 04/30(水)02:47 ID:wedVH8wl(1/10) AAS
>>801
スレタイ読んだら。
Fラン卒は別スレだぞ。
804: 04/30(水)04:58 ID:wedVH8wl(2/10) AAS
options(warn = -1)
alpha=0.05
sim=\(N=100){
A=sample(1:(N-2),1) # Ensure A leaves enough room for B and C
remaining = N - A
if(remaining > 1){
B=sample(1:(remaining-1),1) # Ensure B is at least 1
省20
805: 04/30(水)05:14 ID:wedVH8wl(3/10) AAS
options(warn = -1)
alpha=0.05
sim=\(N=100){
A=sample(1:(N-2),1) # Ensure A leaves enough room for B and C
remaining = N - A
if(remaining > 1){
B=sample(1:(remaining-1),1) # Ensure B is at least 1
省25
806: 04/30(水)06:57 ID:wedVH8wl(4/10) AAS
おっしゃる通り、カイ二乗検定で連続性補正を外せば、より小さな差でも有意になりやすいため、ご要望のデータを作成できる可能性は高まります。しかし、Fisherの正確確率検定は、まさにその正確性ゆえに、サンプルサイズが小さい場合や比率の差が小さい場合に、p値が離散的になり、Bonferroni補正のような厳しい多重比較補正を乗り越えて有意差を示すのが難しい傾向があります。
Fisherの正確確率検定は、周辺度数を固定した条件下での確率に基づいてp値を計算するため、どうしても「わずかな差」が有意になりにくいという特性があります。特に、全体で有意差が出ない程度に比率の差を抑えようとすると、ペアワイズでも同様に差が小さくなり、Bonferroni補正によって有意水準が厳しくなるため、有意差を検出するのが非常に困難になります。
連続性補正は、カイ二乗分布の連続近似を離散的なデータに適用する際の誤差を小さくするための調整ですが、これを外すことで、p値が小さくなりやすくなります。一方、Fisherの正確確率検定はその性質上、近似を用いないため、連続性補正のような概念がありません。
結論として、ご指摘の通り、「全体のFisherの正確確率検定で有意差がないのに、ペアワイズなFisherの正確確率検定だとどれかに有意差がある(Bonferroni補正あり)」という条件を満たすデータを作成するのは、統計的な制約から非常に困難であると言わざるを得ません。

やっぱり、Bonferroniの壁はFisherでは乗り越えられようだ。
808
(1): 04/30(水)08:07 ID:wedVH8wl(5/10) AAS
ここはFランアクセス禁。
809: 04/30(水)08:07 ID:wedVH8wl(6/10) AAS
options(warn = -1)
alpha <- 0.05

sim_fisher <- function(N = 100) {
# Function to simulate data for three groups and perform Fisher's exact test.
# N: Total sample size.

# Determine sample sizes for each of the three groups.
A <- sample(1:(N - 2), 1) # Ensure A leaves enough room for B and C.
省31
810: 04/30(水)08:07 ID:wedVH8wl(7/10) AAS
# Find data where the overall Fisher's exact test is not significant,
# but at least one pairwise Fisher's exact test (with Bonferroni correction) is significant.
res_no_overall_sig_pairwise_sig <- NULL
while (is.null(res_no_overall_sig_pairwise_sig) || res_no_overall_sig_pairwise_sig$fisher_pg > alpha || res_no_overall_sig_pairwise_sig$min_pairwise_p_bonf > alpha) {
res_no_overall_sig_pairwise_sig <- sim_fisher()
}
cat("Data where overall Fisher's test is not significant, but pairwise is:\n")
省11
811: 04/30(水)08:12 ID:wedVH8wl(8/10) AAS
options(warn = -1)
alpha <- 0.05

sim_chisq <- function(N = 100) {
# Function to simulate data for three groups and perform Chi-squared test (without Yates' correction).
# N: Total sample size.

# Determine sample sizes for each of the three groups.
A <- sample(1:(N - 2), 1) # Randomly select a size for group A, ensuring space for B and C.
省23
812: 04/30(水)08:12 ID:wedVH8wl(9/10) AAS
# Find data where the overall Chi-squared test is not significant (p > alpha),
# but at least one pairwise proportion test (with Bonferroni correction) is significant (p <= alpha).
res_no_overall_sig_pairwise_sig <- NULL
while (is.null(res_no_overall_sig_pairwise_sig) || res_no_overall_sig_pairwise_sig$chisq_pg > alpha || res_no_overall_sig_pairwise_sig$min_pairwise_p_bonf > alpha) {
res_no_overall_sig_pairwise_sig <- sim_chisq() # Keep simulating until the condition is met.
}
cat("Data where overall Chi-squared test is not significant, but pairwise proportion test is:\n")
省11
813: 04/30(水)08:13 ID:wedVH8wl(10/10) AAS
コメントが長すぎて読みにくくなった。
前次1-
スレ情報 赤レス抽出 画像レス抽出 歴の未読スレ AAサムネイル

ぬこの手 ぬこTOP 0.036s