Code covered by the BSD License  

Highlights from
aov2apr

Be the first to rate this file! 17 Downloads (last 30 days) File Size: 5.35 KB File ID: #41305

aov2apr

by

 

15 Apr 2013 (Updated )

Two-way analysis of variance with a planned (a priori) factor.

| Watch this File

File Information
Description

The two-way analysis of variance with a planned (a priori) factor follows the next statistical fundamentals (degrees of freedom are between parentheses),

SSTO = SSM + SSE; (N-1 = k-1 + N-k; k = a*b)

SSTO, total sum of squares corrected; SSM, model sum of squares;SSE,error sum of squares (within). [N=Total data;a=Factor 1 levels;b=Factor 2 levels].

SSM = SSA + SSB + SSAB; [k-1 = a-1 + b-1 + (a-1)*(b-1)]

SSA, Factor A sum of squares (Model I or II); SSB, Factor B sum of squares (Model I); SSAB, interaction sum of squares.

SSB = SS1 + SS2 +...+ SSC; (b-1 = 1 + 1 +...+ 1)

SS1,...,SSC, contrast sum of squares.
              
SSj = Sj^2 / SUM(cj^2/nj); j=1,2,...,C

Sj^2 = c1*M1 + c2*M2 +...+ cC*MC

cj, contrast vector; Mj, means vector; nj, sample size vector.

If there is no interaction, it is better to perform two separate one-way ANOVAs. Here, factor A and B with a Model I/II and I (panned), respectively. An interaction effect is a change in the simple main effect of one variable over levels of the second.

In a fixed-model (I), the treatment levels are deliberately selected and will remain constant from one replication to another. Generalization of such a model can be made only to the levels tested. Meanwhile, in a random-model (II), the treatment levels are randomly selected and if we replicated the study we would again choose the levels randomly and would most likely have a whole new set of levels. Results can be generalized to the population levels from which the levels of the independent variable were randomly selected.

Planned contrasts are particular comparisions that the researcher is interested in examining prior to data collection or in certain specific contrasts, but not in the omnibus F test that examines all possible contrasts (Lomax, 2007). Fewer planned comparisions are usually conducted (k - 1), due to their specificity. Each comparision corresponds to an independent hypothesis. To be sure that this is satisfied, we must to have a family of orthogonal planned comparisons.

Orthogonal contrasts are special in the sense that each contrast provides totally unique, nonredundant information about the means under study. If the two contrasts are orthogonal, then the sum of the cross products will be equal to '0'. Otherwise, the contrasts are nonorthogonal.

AOV2APR treats NaN values as missing values, and removes them.

Syntax: function aov2apr(x,m,z)

Inputs:
x – data nx3 matrix (Col 1 = data;Col 2 = factor 1 code [Model I/II];Col 3 = factor 2 code [Model I-planned])
m - contrasts matrix (planned)
z - factor 1 fixed=1;factor 1 random=2

Output:
- Summary statistics from the analysis

Required Products Statistics Toolbox
MATLAB release MATLAB 7.10 (R2010a)
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
Updates
16 Apr 2013

It was added an appropriate format to cite this file.

16 Apr 2013

Text was improved.

Contact us