GANOVA
Instructions of GANOVA
written by Chou, ChunMin, 070209
一、前言
GANOVA是由鄭招明老師與陳學志老師共同撰寫的一個統計程式,主要使用的統計方法即ANOVA。
適用的實驗設計方法有受試者間、受試者內,或是混合設計等皆可使用。
GANOVA的優點如下:
a. 應用範圍廣:受試者間、受試者內、混合設計皆可適用。
b. 程式體積小:不若SAS或SPSS等佔用大量硬碟空間,GANOVA只需幾百KB的空間,並毋須安裝即可使用
c. 自動進行事後比較(post hoc):內行人都知道,心理學常用的受試者內設計,
SAS的proc GLM需要比較複雜的語法,事後比較也需要自己寫error term
SPSS更慘,受試者內完全沒有辦法做事後比較
而GANOVA相當重要的優點是,它會自動對有顯著的變項或交互作用進行Tukey事後比較
然GANOVA也有其限制,若細格人數不等(unequal n)時則無法進行運算。
二、程式元件介紹
執行GANOVA時,需要二個元件:gANOVA.exe and input file。(參考下載本頁附件)
執行結束後會產生一 *.out file。
以下分別對三個元件作介紹。
三、input file
為一純文字檔,內容需指明實驗設計方法、受試者人數、細格平均數(cell mean)等。
舉例如下:
我習慣把input file (source file)稱為 r.txt
裡面共有三部分:第一行標明實驗設計,第二行標明受試者人數,變項level數,第三行以後為cell mean
例子一:受試者內設計
3(0): 加上受試者變項,共有3個變項,另兩個為受試者內變項
6,2,3: 依序表示,n=6, 第一個變項 leve為2, 第二個變項 level為3,
celll means: 排列方法,# of rows = # of subjects, # of columns = # of conditions
cell means排列方法為巢狀式,也就是說,每一個subject的cell means排列為 (a1b1),(a1b2),(a1b3),(a2b1),(a2b2),(a2b3)
例子二:混合設計
4(1): 加上受試者變項,共有4個變項,其中受試者間變項有1個,受試者內變項2個
2,3,2,3:依序表示,受試者間,level=2 ; subject n=3 ; 受試者內變項A level=2; 受試者內變項B level=3
cell means排列方式:前三rows為受試者間第一組,n=3; 後三rows為受試者間第二組,n=3
columns排列方法與上例同
四、GANOVA.exe
執行GANOVA需要DOS環境下。「開始」->「執行」,打入cmd之後,可以進入DOS模式。
請把目前資料夾換到放置GANOVA與source file的資料夾。
然後打入 「ganova.exe sourceFileName.txt outputFileName.out」執行即可
當畫面出現「work well done!」表示運作成功
五、Output file
成功執行程式後,會在同一個資料夾產生一純文字檔,
例舉例一的output檔案
*****************************************************************************
* General ANOVA Program *
* Vesion 3.0 *
* Chao-Ming Cheng & Shyue-Jyh Chern *
* Department of Psychology *
* National Taiwan University *
* Nov 19 1996 *
*****************************************************************************
General Information (標明input檔輸入的資訊,可以double check你之前輸入正確與否)
----------------------------------------------------------------------------
Experimental Design : ABS
No. of Variables (Including Ss) : 3
No. of Between-Ss Variables : 0
No. of Within-Ss Variables : 2
Data File Name : r.txt
Output Device : test.out
Within Subject Variable 1 : A
Within Subject Variable 2 : B
Subject Variable : S
Levels of A : 2
Levels of B : 3
Levels of S : 6
Significant criterion : 0.050000
No transformation !
----------------------------------------------------------------------------
Cell Means & SD (標出各種marginal means)
----------------------------------------------------------------------------
Means of Ai :
A1= 0.895[ 0.103] A2= 0.757[ 0.196]
Means of Bj :
B1= 0.917[ 0.060] B2= 0.841[ 0.151]
B3= 0.719[ 0.204]
Means of AiBj :
A1B1= 0.947[ 0.038] A1B2= 0.890[ 0.114]
A1B3= 0.848[ 0.112] A2B1= 0.888[ 0.064]
A2B2= 0.792[ 0.167] A2B3= 0.590[ 0.193]
----------------------------------------------------------------------------
Summary Table of ANOVA (大家熟悉的ANOVA table,其中B變項有顯著主要效果)
----------------------------------------------------------------------------
Source SS df MS F P
----------------------------------------------------------------------------
S 0.105 5 0.021
A 0.172 1 0.172 26.503 0.0044
AS 0.032 5 0.006
B 0.240 2 0.120 4.496 0.0399
BS 0.267 10 0.027
AB 0.067 2 0.034 1.935 0.1940
ABS 0.174 10 0.017
----------------------------------------------------------------------------
* means difference between row-mean & column-mean
come up 0.05 significant level.
** means difference between row-mean & column-mean
come up 0.01 significant level.
MsError = 0.026697
df(MsError) = 10
# of groups = 3
cell in group = 12
q(10,3).05 = 3.880000
q(10,3).01 = 5.270000
C(.05) = 0.183008
C(.01) = 0.248570
(自動進行Tukey post hoc test,可以看出來B1與B2兩個level有差異)
Label | B1 B2 B3
Means | 0.917 0.841 0.719
----------------------------------------
B1 | *
B2 |
B3 |
----------------------------------------------------------------------------
( End)