ANOVAN with possibility of columns as the variables as input

2 次查看(过去 30 天)
Hi
Hi, I have my variables in columns in a long matrix (165x 18) (results of 165 participants on 18 different conditions), and need to test which of the variables are statistically different. However, in the matrix 3 within variables are present. Furthermore, there are some values missing (therefore i wont be able to make use of anova2)... I would like to investigate the effect these within variables together and seperately.
The within values are as followed:
MP = egocentric/allocentric.ambiguous -->>{'egocentric','egocentric','egocentric','egocentric','egocentric','egocentric','allocentric','allocentric','allocentric','allocentric','allocentric','allocentric','ambiguous','ambiguous','ambiguous','ambiguous','ambiguous','ambiguous'};
Trials = yes/no --> {'yes','yes','yes','no','no','no','yes','yes','yes','no','no','no','yes','yes','yes','no','no','no',};
digits = zero/two/five --> {'zero', 'two','five','zero', 'two','five','zero', 'two','five','zero', 'two','five','zero', 'two','five','zero', 'two','five',};
So, i know i need to make use of anovan, however I really struggle to make this work... Is there someone who could help me how to test this? I highly appreciate it, thank you in advance!
0 Comments

采纳的回答

Cris LaPierre
Cris LaPierre 2020-1-22
I don't quite understand you example, but for anovan, the expected input is a column vector of numbers (nx1) and a cell array of factors.
To create an input variable for multicolumn data, do the following:
X = data(:)
To create 3 factor variables, A, B and C, define each one separately. Each entry indicates the factor level for the corresponding value in X (0 or 1).
A = [0 0 1 1...];
B = [0 0 0 0 ...];
C = [0 0 0 0 ...];
If it helps, you can visualize it this way:
level | A | B | C | X
(1) | 0 | 0 | 0 | n1
(1) | 0 | 0 | 0 | n2
a | 1 | 0 | 0 | n3
a | 1 | 0 | 0 | n4
...
Finally, I can call the anovan function with the inputs I've created and specify that I want to use the full model (all possible interactions).
anovan(X(:),{A,B,C},'varnames',{'A','B','C'},"model","full")
  1 个评论
Cris LaPierre
Cris LaPierre 2020-1-22
You can also specify specific interactions doing something like this
anovan(y,{A,B,A.*B,A.^2},'varnames',{'A','B','AB','A^2'})

请先登录,再进行评论。

更多回答(2 个)

annie
annie 2020-1-22
heyy thanks for the reply! but i still dont really understand it... cause if i do data(:) then i will get a 1854x1 vector and then i'm really confused how to specify the factor variables
  1 个评论
Cris LaPierre
Cris LaPierre 2020-1-22
Your factors are what indicate the test conducted on each row. For this reason, each one (A, B and C) would be 1854x1 long.

请先登录,再进行评论。


annie
annie 2020-1-22
Ahh nevermind, i think i understand it! Thanks!!

类别

Help CenterFile Exchange 中查找有关 Analysis of Variance and Covariance 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by