{"text_format":"1","workbook":"xlsx","n_sheets":2,"sheets":["exact.xls","exact.xlm"],"not_rendered":{"charts":0,"images":1,"macros":1,"external_links":0,"defined_names":25,"comments":1,"pivot_tables":0},"unopened":[],"bounds":{"document_bytes":16777216,"sheet_cells":100000,"rows_first":2000,"rows_last":500,"rows_between":2000,"halvings":0,"cell_chars":16384,"cell_head_chars":4096},"cells_cut":0,"cells_raw":0,"read":"whole","date_system":"1904"}

{"sheet":"exact.xls","index":0,"n_rows":28,"n_cols":7,"rows_kept":28,"cut":false,"hidden":false,"merged":[[27,0,29,3],[1,6,5,15],[8,6,9,15],[18,0,18,1],[8,0,8,1],[9,0,9,1],[14,0,14,1],[15,0,15,1],[17,0,17,1],[10,1,12,1],[10,0,12,0]]}
["実測値表（緑セルのみ入力）","Aコーパス","Bコーパス","合計",null,null,"Fisherの正確確率検定用テンプレートV1.0　【神戸大学　石川慎一郎研究室　2015/10/20】"]
["X頻度",200,100,{"$f":"C2+B2","v":300},null,null,"「Fisherの正確確率検定」の実行用テンプレートです。p値を近似するカイ二乗検定などと異なり，ありうるすべての組み合わせについて実際の計算結果をふまえてp値を直接に計算することから，近年，カイ二乗検定に代えて，標準法としての使用が推奨されています。このテンプレートは，Paul Dickman（1994）がマクロとして開発し，Jiajin Xu（2006）が修正したものを，石川慎一郎（2015）が日本語化して，コーパス解析用に用語などを改変し，統計用語の解説を加えたものです。マクロの著作権は第1開発者のDr. Dickmanに帰属します。http://www.pauldickman.com/"]
["X以外頻度",{"$f":"B4-B2","v":9800},{"$f":"C4-C2","v":9900},{"$f":"C3+B3","v":19700}]
["総語数",10000,10000,{"$f":"D2+D3","v":20000}]
["X頻度（PMW)",{"$f":"B2/B4*1000000","v":20000},{"$f":"C2/C4*1000000","v":10000},"←100万語換算頻度"]
[]
[]
[]
["Fisherの正確確率検定",null,"p=",4.6092861166017832E-9,"(両側検定)",null,"←AはBより大きい（小さい）かを調べる場合は片側検定，AとBに差があるかどうかを調べる場合は両側検定を使います（※通例は両側検定です）。"]
["「期待値5未満」に限らず，すべてのデータについて標準検定法として使用可能"]
["効果量は，Aコーパスにおける単語Ｘの出現確率が，Bコーパスにおける出現確率の何倍に相当するかを示す（右解説参照）。いずれか１つを報告すればよく，コーパス研究では「オッズ比」が多く使われる。","効果量","RR（相対確率）=",1.3401360544217686,1.2355705419712506,1.4535508765819494,"←95％信頼区間（95% CI）の下限と上限です。測定を仮想的に繰り返すと95％はこの範囲に収まります。"]
[]
[null,null,"OR（オッズ比）=",2.0204081632653059,1.586658564320071,2.5727331878351296,"←同上"]
[]
["カイ二乗検定",null,"X2=",33.840947546531304]
["（期待値-実測値）^2/期待値で計算。期待値5未満は使用不可（コクラン・ルール）。",null,"p=",5.9806727448735563E-9,null,null,"(no need to use the calculate button)"]
[]
["カイ二乗検定（Yatesの連続性補正あり）",null,"X2=",33.167512690355338,"(Yates補正有)"]
["連続値を取るX2分布への適合度を高める。（期待値-実測値-0.5）^2/期待値で計算。",null,"p=",8.4551425305800279E-9]
[]
[]
[]
["期待値表（入力不可）","Aコーパス","Bコーパス","合計"]
["X頻度",{"$f":"$D2*B$4/$D$4","v":150},{"$f":"$D2*C$4/$D$4","v":150},{"$f":"B24+C24","v":300}]
["X以外頻度",{"$f":"$D3*B$4/$D$4","v":9850},{"$f":"$D3*C$4/$D$4","v":9850},{"$f":"B25+C25","v":19700}]
["総語数",{"$f":"B24+B25","v":10000},{"$f":"C24+C25","v":10000},{"$f":"D24+D25","v":20000}]
[]
["《論文での結果の報告例》：　Fisherの正確確率検定の結果，AコーパスとBコーパスにおける単語Xの頻度の差は有意であり，A(orB)コーパスにおいてより多く出現することが確認された（OR=3.0, 95% CI=1.2 to 4.5; p=.03）。"]

{"sheet":"exact.xlm","index":1,"n_rows":120,"n_cols":5,"rows_kept":120,"cut":false,"hidden":false,"merged":[]}
[null,"  Summary Information",null,"get_help","return_from_help"]
["Title:","fisher.xlm",null,{"$f":"WORKBOOK.SELECT(\"help.xls\",\"help.xls\")","v":true},{"$f":"WORKBOOK.SELECT(\"exact.xls\",\"exact.xls\")","v":true}]
["Version:","v1.0",null,{"$f":"WINDOW.MAXIMIZE()","v":true},{"$f":"WINDOW.MAXIMIZE()","v":true}]
["Author","Dr. Paul Dickman",null,{"$f":"RETURN()","v":true},{"$f":"RETURN()","v":true}]
["Corporation:","Department of Medical Epidemiology"]
[null,"PO Box 281, Karolinska Institutet"]
[null,"S-171 77 Stockholm, Sweden"]
[null,"http://www.pauldickman.com"]
[null,"paul.dickman@mep.ki.se"]
[null,"Copyright 1994-1999 Paul Dickman"]
["Creation Date:","September, 1994"]
[]
["names","  commands","comments"]
[]
[null,"exact"]
[null,{"$f":"PROTECT.DOCUMENT(FALSE,FALSE,,FALSE)","v":true},"Unprotect document"]
[null,"  =SET.NAME(\"start_cell\",GET.CELL(1))","get current cell reference (will return there at end)"]
[null,{"$f":"WINDOW.MAXIMIZE()","v":true}]
[null,{"$f":"SELECT(\"R9C4:R19C6\")","v":true},"clear previous values"]
[null,{"$f":"CLEAR(1)","v":true}]
[null,{"$f":"ECHO(FALSE)","v":true},"Turn off screen updating"]
[null,{"$f":"SET.VALUE(i,0)","v":true},"initialise i"]
["obs_n11",{"$f":"GET.CELL(5,!B2)","v":200},"Get the initial value of n11"]
["n_1_p",{"$f":"GET.CELL(5,!D2)","v":300},"Get the value of n1+"]
["n_p_1",{"$f":"GET.CELL(5,!B4)","v":10000},"Get the value of n+1"]
["n",{"$f":"GET.CELL(5,!D4)","v":20000},"Get the value of n"]
[]
[null,{"$f":"IF(NOT(ISNUMBER(!B2)),GOTO(error_no_number),)","v":0},"Check for numbers"]
[null,{"$f":"IF(NOT(ISNUMBER(!B3)),GOTO(error_no_number),)","v":0}]
[null,{"$f":"IF(NOT(ISNUMBER(!C2)),GOTO(error_no_number),)","v":0}]
[null,{"$f":"IF(NOT(ISNUMBER(!C3)),GOTO(error_no_number),)","v":0}]
[]
[null,{"$f":"IF(!B2<0,GOTO(error_neg),)","v":0},"Check for negative numbers"]
[null,{"$f":"IF(!B3<0,GOTO(error_neg),)","v":0}]
[null,{"$f":"IF(!C2<0,GOTO(error_neg),)","v":0}]
[null,{"$f":"IF(!C3<0,GOTO(error_neg),)","v":0}]
[]
[null,{"$f":"IF(!B2<>INT(!B2),GOTO(error_non_int),)","v":0},"Check for integers"]
[null,{"$f":"IF(!B3<>INT(!B3),GOTO(error_non_int),)","v":0}]
[null,{"$f":"IF(!C2<>INT(!C2),GOTO(error_non_int),)","v":0}]
[null,{"$f":"IF(!C3<>INT(!C3),GOTO(error_non_int),)","v":0}]
[]
[null,{"$f":"MESSAGE(TRUE,\"Calculating test statistics now...\")","v":true},"Put a message in the status bar"]
[]
[null,{"$f":"SELECT(\"R15C4\")","v":true}]
[null,{"$f":"FORMULA.ARRAY(\"=SUM((R[-13]C[-2]:R[-12]C[-1]-R[9]C[-2]:R[10]C[-1])^2/(R[9]C[-2]:R[10]C[-1]))\")","v":true},"Chi-square"]
[null,{"$f":"SELECT(\"R16C4\")","v":true}]
[null,{"$f":"FORMULA(\"=CHIDIST(R[-1]C,1)\")","v":true},"Chi-square p-value"]
[null,{"$f":"FORMAT.NUMBER(\"0.0000\")","v":true}]
[]
[null,{"$f":"SELECT(\"R18C4\")","v":true}]
[null,{"$f":"FORMULA.ARRAY(\"=SUM((ABS(R[-16]C[-2]:R[-15]C[-1]-R[6]C[-2]:R[7]C[-1])-0.5)^2/(R[6]C[-2]:R[7]C[-1]))\")","v":true},"Corrected Chi-square"]
[null,{"$f":"SELECT(\"R19C4\")","v":true}]
[null,{"$f":"FORMULA(\"=CHIDIST(R[-1]C,1)\")","v":true},"p-value"]
[null,{"$f":"FORMAT.NUMBER(\"0.0000\")","v":true}]
[null,{"$f":"FORMULA(\"(Yates補正有)\",!E18)","v":true}]
[]
[null,{"$f":"SELECT(\"R11C4\")","v":true}]
[null,{"$f":"FORMULA(\"=(R[-9]C[-2]/R[-9]C)/(R[-8]C[-2]/R[-8]C)\")","v":true},"Relative Risk (RR)"]
[null,{"$f":"SELECT(\"R11C5\")","v":true}]
[null,{"$f":"FORMULA(\"=RC[-1]*EXP(-1.96*SQRT(((1-R[-9]C[-3]/R[-9]C[-1])/R[-9]C[-3])+((1-R[-8]C[-3]/R[-8]C[-1])/R[-8]C[-3])))\")","v":true},"RR lower limit"]
[null,{"$f":"SELECT(\"R11C6\")","v":true}]
[null,{"$f":"FORMULA(\"=RC[-2]*EXP(1.96*SQRT(((1-R[-9]C[-4]/R[-9]C[-2])/R[-9]C[-4])+((1-R[-8]C[-4]/R[-8]C[-2])/R[-8]C[-4])))\")","v":true},"RR upper limit"]
[]
[null,{"$f":"SELECT(\"R13C4\")","v":true}]
[null,{"$f":"FORMULA(\"=(R[-11]C[-2]*R[-10]C[-1])/(R[-11]C[-1]*R[-10]C[-2])\")","v":true},"Odds ratio (OR)"]
[null,{"$f":"SELECT(\"R13C5\")","v":true}]
[null,{"$f":"FORMULA.ARRAY(\"=RC[-1]*EXP(-1.96*SQRT(SUM(1/R[-11]C[-3]:R[-10]C[-2])))\")","v":true},"OR lower limit"]
[null,{"$f":"SELECT(\"R13C6\")","v":true}]
[null,{"$f":"FORMULA.ARRAY(\"=RC[-2]*EXP(1.96*SQRT(SUM(1/R[-11]C[-4]:R[-10]C[-3])))\")","v":true},"OR upper limit"]
[null,{"$f":"SELECT(\"R11C5:R13C5\")","v":true}]
[null,{"$f":"FORMAT.NUMBER(\"(0.000\"\",\"\"\")","v":true}]
[null,{"$f":"SELECT(\"R11C6:R13C6\")","v":true}]
[null,{"$f":"FORMAT.NUMBER(\"0.000)\")","v":true}]
[null,{"$f":"SELECT(\"R11C4:R13C4\")","v":true}]
[null,{"$f":"FORMAT.NUMBER(\"0.000\")","v":true}]
[null,{"$f":"SELECT(\"R11C6:R13C6\")","v":true}]
[null,{"$f":"ALIGNMENT(2,FALSE,3,0)","v":true}]
[]
["obs",{"$f":"HYPGEOMDIST(obs_n11,n_p_1,n_1_p,n)","v":1.5957760687086099E-9},"Probability of observed table"]
[null,{"$f":"IF(ISERROR(obs),GOTO(error_too_big),)","v":0},"Check that calculation was performed successfully"]
[]
["start",{"$f":"MAX(0,n_1_p+n_p_1-n)","v":0},"min value of n11"]
["stop",{"$f":"MIN(n_1_p,n_p_1)","v":300},"max value of n11"]
[null,{"$f":"FOR(\"n_1_1\",start,stop)","v":true},"loop thru all possible values of n11"]
["prob",{"$f":"HYPGEOMDIST(n_1_1,n_p_1,n_1_p,n)","v":5.0379271702878355E-92},"Calculate hypergeometric prob."]
[null,{"$f":"IF(ISERROR(prob),GOTO(error_too_big),)","v":0},"Check that calculation was performed successfully"]
["flag",{"$f":"(prob<=obs)","v":true}]
[]
[null,{"$f":"IF(flag)","v":true}]
["i",{"$f":"i+prob","v":4.6092861166017832E-9},"cumulative sum of probabilities"]
[null,{"$f":"END.IF()","v":true}]
[]
[null,{"$f":"NEXT()","v":true}]
[null,{"$f":"FORMULA(i,!D9)","v":true},"put the final result (p-value) for exact test"]
[null,{"$f":"FORMULA(\"(両側検定)\",!E9)","v":true}]
[null,{"$f":"SELECT(!D9)","v":true}]
[null,{"$f":"FORMAT.NUMBER(\"0.0000\")","v":true}]
[]
[null,{"$f":"GOTO(end)","v":true}]
["error_no_number",{"$f":"ALERT(\"Enter four positive numbers into the 2 by 2 table before running the test.\",3)","v":true}]
[null,{"$f":"GOTO(end)","v":true}]
["error_too_big",{"$f":"ALERT(\"Could not compute Fisher's exact test.  This is probably because the numbers are too large for Excel to handle.\",3)","v":true}]
[null,{"$f":"GOTO(end)","v":true}]
["error_non_int",{"$f":"ALERT(\"Table cells must be positive integers.  At least one of the numbers is not an integer.\",3)","v":true}]
[null,{"$f":"GOTO(end)","v":true}]
["error_neg",{"$f":"ALERT(\"Table cells must be positive integers.  At least one of the numbers is negative.\",3)","v":true}]
["end",{"$f":"MESSAGE(FALSE)","v":true},"Clear the status bar"]
[null,{"$f":"SELECT(\"R9C4:R19C4\")","v":true}]
[null,{"$f":"ALIGNMENT(2,FALSE,3,0)","v":true},"Left allign"]
[null,{"$f":"SELECT(\"R9C4:R19C6\")","v":true}]
[null,{"$f":"COPY()","v":true}]
[null,{"$f":"PASTE.SPECIAL(3,1,FALSE,FALSE)","v":true},"paste as values"]
[null,{"$f":"SELECT(!B2)","v":true}]
[null,{"$f":"ALIGNMENT(4,FALSE,3,0)","v":true},"Only done to clear the clipboard"]
[null,{"$f":"CALCULATE.NOW()","v":true}]
[null,{"$f":"PROTECT.DOCUMENT(TRUE,FALSE,,TRUE)","v":true},"Protect document"]
[null,"  =FORMULA.GOTO(REFTEXT(start_cell,FALSE))","Return to starting cell"]
[null,{"$f":"ECHO(TRUE)","v":true},"Turn screen updating back on"]
[null,{"$f":"RETURN()","v":true}]