==独立性の検定==

・クロス集計表      
        0  1 合計
  0    16  4   20
  1     4  6   10
  合計 20 10   30

・行方向のパーセント      
           0     1  合計
  0     80.0  20.0 100.0
  1     40.0  60.0 100.0
  合計  66.7  33.3 100.0

	Spearman's rank correlation rho

data:  df[, 1] and df[, 2]
S = 2697, p-value = 0.02851
alternative hypothesis: true rho is not equal to 0
sample estimates:
rho 
0.4 


	Pearson's Chi-squared test with Yates' continuity correction

data:  tab1
X-squared = 3.1687, df = 1, p-value = 0.07506


	Fisher's Exact Test for Count Data

data:  tab1
p-value = 0.03871
alternative hypothesis: true odds ratio is greater than 1
95 percent confidence interval:
 1.098139      Inf
sample estimates:
odds ratio 
  5.585888 


	Fisher's Exact Test for Count Data

data:  tab1
p-value = 0.9952
alternative hypothesis: true odds ratio is less than 1
95 percent confidence interval:
  0.00000 32.67808
sample estimates:
odds ratio 
  5.585888 


	Fisher's Exact Test for Count Data

data:  tab1
p-value = 0.04486
alternative hypothesis: true odds ratio is not equal to 1
95 percent confidence interval:
  0.8602909 44.0017191
sample estimates:
odds ratio 
  5.585888 


	2-sample test for equality of proportions with continuity correction

data:  tab1
X-squared = 3.1687, df = 1, p-value = 0.07506
alternative hypothesis: two.sided
95 percent confidence interval:
 -0.02560902  0.82560902
sample estimates:
prop 1 prop 2 
   0.8    0.4 

        Likelihood ratio test
G square value             df        P value 
    4.71451982     1.00000000     0.02990892 
2 by 2 table analysis: 
------------------------------------------------------ 
Outcome   : 0 
Comparing : 0 vs. 1 

   0 1    P(0) 95% conf. interval
0 16 4     0.8    0.5722   0.9229
1  4 6     0.4    0.1583   0.7026

                                   95% conf. interval
             Relative Risk: 2.0000    0.9076   4.4072
         Sample Odds Ratio: 6.0000    1.1254  31.9892
Conditional MLE Odds Ratio: 5.5859    0.8603  44.0017
    Probability difference: 0.4000    0.0405   0.6607

             Exact P-value: 0.0449 
        Asymptotic P-value: 0.0359 
------------------------------------------------------
$table
   0 1    P(0) 95% conf.  interval
0 16 4     0.8 0.5721531 0.9228665
1  4 6     0.4 0.1583420 0.7025951

$measures
                                      95% conf.   interval
             Relative Risk: 2.000000 0.90761086  4.4071751
         Sample Odds Ratio: 6.000000 1.12538095 31.9891678
Conditional MLE Odds Ratio: 5.585888 0.86029095 44.0017191
    Probability difference: 0.400000 0.04052831  0.6607354

$p.value
[1] 0.03587920 0.04485792

$data
       
         0  1 Total
  0     16  4    20
  1      4  6    10
  Total 20 10    30

$measure
   odds ratio with 95% C.I.
    estimate    lower    upper
  0 1.000000       NA       NA
  1 5.493488 1.049261 34.20932

$p.value
   two-sided
    midp.exact fisher.exact chi.square
  0         NA           NA         NA
  1 0.04355305   0.04485792 0.07505987

$correction
[1] TRUE

attr(,"method")
[1] "median-unbiased estimate & mid-p exact CI"
$data
       
         0  1 Total
  0     16  4    20
  1      4  6    10
  Total 20 10    30

$measure
   odds ratio with 95% C.I.
    estimate     lower    upper
  0 1.000000        NA       NA
  1 5.585888 0.8602909 44.00172

$p.value
   two-sided
    midp.exact fisher.exact chi.square
  0         NA           NA         NA
  1 0.04355305   0.04485792 0.07505987

$correction
[1] TRUE

attr(,"method")
[1] "Conditional MLE & exact CI from 'fisher.test'"
$data
       
         0  1 Total
  0     16  4    20
  1      4  6    10
  Total 20 10    30

$measure
   odds ratio with 95% C.I.
    estimate    lower    upper
  0     1.00       NA       NA
  1     3.84 1.079024 25.99641

$p.value
   two-sided
    midp.exact fisher.exact chi.square
  0         NA           NA         NA
  1 0.04355305   0.04485792 0.07505987

$correction
[1] TRUE

attr(,"method")
[1] "small sample-adjusted UMLE & normal approx (Wald) CI"
$data
       
         0  1 Total
  0     16  4    20
  1      4  6    10
  Total 20 10    30

$measure
   odds ratio with 95% C.I.
    estimate    lower    upper
  0        1       NA       NA
  1        6 1.125381 31.98917

$p.value
   two-sided
    midp.exact fisher.exact chi.square
  0         NA           NA         NA
  1 0.04355305   0.04485792 0.07505987

$correction
[1] TRUE

attr(,"method")
[1] "Unconditional MLE & normal approximation (Wald) CI"
