Memorandums

知覚・認知心理学の研究と教育をめぐる凡庸な日々の覚書

MacAnova: データの読み込みと基礎的処理

2009-08-12 | MacANOVA
MacAnovaはRなどと類似しているので、データの読み込みなどもcommand windowで指定することができるが、初心者にはクリップボードにデータ(変数を入力しておいたはおうが楽)をおいて、そのままMacAnovaに読み込ませるのが簡単だろう。
Excelなどのデータを範囲指定してcopyしておき、MacAnovaで
Data --- Read data from the clipboard --- Labelled columns
とすればデータが保持される。あとは、変数が明示されるので、Statisticsから処理を選択する。分散分析以外にも多くの処理が可能だが、分散分析ならば
ANOVA modeling --- build ANOVAmodel...
などを指定できる。

MacAnova home page:
http://www.stat.umn.edu/macanova
コメント
  • X
  • Facebookでシェアする
  • はてなブックマークに追加する
  • LINEでシェアする

Multiple comparisons

2005-12-05 | MacANOVA
10. Examples of Linear Model Analyses (manchp10.pdf)
10.8 Randomized complete blocks
10.8.1 Multiple comparisons
:
Macro pairedcomp in file design.mac distributed with MacAnova is to be run immediately after an anova() command. It computes all the pairwise differences in the effects for a factor and displays them in a form that indicates which are significantly different.
:

References
MacAnova 4.07 Users' Guide
ftp://ftp.stat.umn.edu/pub/macanova/docs/manual/ManualTOC.html
コメント
  • X
  • Facebookでシェアする
  • はてなブックマークに追加する
  • LINEでシェアする

Randomized Block ANOVA

2005-12-05 | MacANOVA
Randomized Block (Two-way) Analysis of Variance (anova(), factor(), tabs())

Cmd> failures <- vector(8,10,12,13,11, 2,6,7,11,5, 4,10,9,8,10, 3,5,9,10,6, 9,7,5,5,3)

Cmd> reps <- factor(rep(run(5),5))#vector(1,2,3,4,5,1,2,3,4,5,...,)

Cmd> treatment<-factor(rep(run(5),rep(5,5)))#vector(1,1,1,1,1,2,..)

Cmd> hconcat(reps, treatment, failures) # see them all
(1,1) 1 1 8
(2,1) 2 1 10
(3,1) 3 1 12
(4,1) 4 1 13
(5,1) 5 1 11
(6,1) 1 2 2
(7,1) 2 2 6
(8,1) 3 2 7
(9,1) 4 2 11
(10,1) 5 2 5
(11,1) 1 3 4
(12,1) 2 3 10
(13,1) 3 3 9
(14,1) 4 3 8
(15,1) 5 3 10
(16,1) 1 4 3
(17,1) 2 4 5
(18,1) 3 4 9
(19,1) 4 4 10
(20,1) 5 4 6
(21,1) 1 5 9
(22,1) 2 5 7
(23,1) 3 5 5
(24,1) 4 5 5
(25,1) 5 5 3

Cmd> tabs(failures,treatment,mean:T,count:T) # treatment means component: mean
component: mean
(1) 10.8 6.2 8.2 6.6 5.8
component: count
(1) 5 5 5 5 5

Cmd> tabs(failures, reps, mean:T,count:T) # block means component: mean
component: mean
(1) 5.2 7.6 8.4 9.4 7
component: count
(1) 5 5 5 5 5


Cmd> anova("failures = reps + treatment",fstat:T) # do ANOVA Model used is failures = reps + treatment
Model used is failures = reps + treatment
DF SS MS F P-value
CONSTANT 1 1413.8 1413.8 261.32348 p<1e-08 treatment 4 83.84 20.96 3.87431 0.021886
ERROR1 16 86.56 5.41

出力画面どおりの画面配置ではない。もとの画面は見やすいし、必要充分で使いやすいと思う。

References
An Introduction to MacAnova
pp.62
コメント
  • X
  • Facebookでシェアする
  • はてなブックマークに追加する
  • LINEでシェアする

describe()

2005-12-05 | MacANOVA
Cmd> x <- vector(prob_1[,1]); y <- vector(prob_1[,2])

Cmd> describe(y) # y is the second column of prob_1
component: n
(1) 8
component: min
(1) 1.9
component: q1
(1) 3.05
component: median
(1) 4.2
component: q3
(1) 5.6
component: max
(1) 7.9
component: mean
(1) 4.4375
component: var
(1) 3.6027
コメント
  • X
  • Facebookでシェアする
  • はてなブックマークに追加する
  • LINEでシェアする

Combining vectors and matrices

2005-12-05 | MacANOVA
Combining vectors and matrices vector(), hconcat() and vconcat()
Example

Cmd> vector(prob_1) # prob_1 is the 8 by 2 matrix used before
(1) 0.34 0.35 0.39 0.39 0.41
(6) 0.41 0.49 0.68 2.8 1.9
(11) 3.3 5.6 4.2 5.6 4.2
(16) 7.9

First you get all the values in column 1 of data, followed by the values in column 2. Sometimes you will want to make a larger matrix by combining together side by side two or more vectors or matrices. Obviously all the pieces must have the same number of rows. For example, suppose you want to put vectors x and y back together in a matrix, together with a column containing the case numbers.
Example
Cmd> data1 <- hconcat(vector(1,2,3,4,5,6,7,8),x,y); data1
(1,1) 1 0.34 2.8
(2,1) 2 0.35 1.9
(3,1) 3 0.39 3.3
(4,1) 4 0.39 5.6
(5,1) 5 0.41 4.2
(6,1) 6 0.41 5.6
(7,1) 7 0.49 4.2
(8,1) 8 0.68 7.9
This has produced the 8 by 3 matrix data1.
コメント
  • X
  • Facebookでシェアする
  • はてなブックマークに追加する
  • LINEでシェアする

MacAnova : 入力 例(行列)

2005-12-05 | MacANOVA
Cmd> prob_1 <-matrix(vector(.34,.35,.39,.39,.41,.41,.49,.68,2.8,1.9,3.3,5.6,4.2,5.6,4.2,7.9), 8)

Cmd> prob_1
(1,1) 0.34 2.8
(2,1) 0.35 1.9
(3,1) 0.39 3.3
(4,1) 0.39 5.6
(5,1) 0.41 4.2
(6,1) 0.41 5.6
(7,1) 0.49 4.2
(8,1) 0.68 7.9
コメント
  • X
  • Facebookでシェアする
  • はてなブックマークに追加する
  • LINEでシェアする

MacAnova : help 例

2005-12-05 | MacANOVA
Cmd> help(anova:"?")
Available subtopics for topic 'anova' are:
usage
examples_1
weights
omitting_model
side_effect_variables_created
keywords
balanced_designs
nonbalanced_designs
after_regress
see_also
Type help(anova:vector("subtopicA","subtopicB",...))
コメント
  • X
  • Facebookでシェアする
  • はてなブックマークに追加する
  • LINEでシェアする

MacAnova 出力例

2005-12-05 | MacANOVA
Example
Cmd> w <- sqrt(10); w # print w with default significance
(1) 3.1623

コメント
  • X
  • Facebookでシェアする
  • はてなブックマークに追加する
  • LINEでシェアする

MacAnova

2005-12-03 | MacANOVA
A Program for Statistical Analysis and Matrix Algebra

MacAnova is a free, open source, interactive statistical analysis program for Windows, Macintosh, and Linux written by Gary W. Oehlert and Christopher Bingham, both of the School of Statistics, University of Minnesota.

In spite of its name, MacAnova is not just for Macintosh computers and not just for doing Analysis of Variance.
:
Core MacAnova has a functional/command oriented interface, but an increasing number of capabilities are available through a menu/dialog/mouse type interface. Although the language and syntax are S-like (for those of you familiar with S, S-Plus or R), MacAnova is not S or R.
:
References
MacAnova
使用法は、Documentation/An Introduction to MacAnova 参照。
コメント
  • X
  • Facebookでシェアする
  • はてなブックマークに追加する
  • LINEでシェアする