Closed ProfAthlete closed 4 years ago
Hello ProfAthlete,
Are you able to access and run the following example script? ./spm1d/examples/stats1d/ex_anova1.py
This script demonstrates both methods of organizing data. As you noticed, only method 1 is supported for more complex types of ANOVA like repeated-measures and two- and three-way ANOVA.
Here is a snippet you can use for this dataset:
fname = 'Sample3.txt'
Y1 = np.loadtxt(fname, usecols = (0,1,2), unpack = True)
Y2 = np.loadtxt(fname, usecols = (3,4,5), unpack = True)
Y3 = np.loadtxt(fname, usecols = (6,7,8), unpack = True)
Y = np.vstack([Y1,Y2,Y2])
A = np.array( [1,1,1, 2,2,2, 3,3,3] )
SUBJ = np.array( [1,2,3, 1,2,3, 1,2,3] )
F = spm1d.stats.anova1(Y, A)
F = spm1d.stats.anova1rm(Y, A, SUBJ)
Yes, I was able to access it, thank you for the explanation.
I realize that the sample dataset I appended did not contain ample data to produce a within-subjects' curve for the SPM{F} plot. but suppose I did, would the within-subjects' curve appear on the plot as demonstrated here?
And if' I were to run a Two-way or Two-way Repeated-measures ANOVA, does that mean I will be defining B as
B = np.array( [1,1,1, 2,2,2, 3,3,3, ..., n,n,n,] ) as well?
What does it mean by a 'SUBJ vector' as compared to the previous SUBJ we defined before?
would the within-subjects' curve appear on the plot as demonstrated here?
Please click on the "source code" link associated with that example, where shows how to create that plot. You need to run the within- and between- models separately.
And if' I were to run a Two-way or Two-way Repeated-measures ANOVA, does that mean I will be defining B as
That looks incorrect because B
matches A
. A
and B
should look something like this:
A = np.array( [1,1,1, 2,2,2, 3,3,3, 1,1,1, 2,2,2, 3,3,3] )
B = np.array( [1,1,1, 1,1,1, 1,1,1, 2,2,2, 2,2,2, 2,2,2] )
What does it mean by a 'SUBJ vector' as compared to the previous SUBJ we defined before?
Like A
and B
, SUBJ
contains labels. A
and B
contain labels the represent the different levels of the two experimental factors, and SUBJ
contains labels that represent individuals. For two-way RM ANOVA the three label vectors should look something like this:
A = np.array( [1,1,1, 2,2,2, 3,3,3, 1,1,1, 2,2,2, 3,3,3, 1,1,1, ...] )
B = np.array( [1,1,1, 1,1,1, 1,1,1, 2,2,2, 2,2,2, 2,2,2, 2,2,2, ...] )
SUBJ = np.array( [1,1,1, 1,1,1, 1,1,1, 1,1,1, 1,1,1, 1,1,1, 2,2,2, ...] )
Thank you for the elaboration. I think I'm slowly getting the picture.
I do have another question:
I notice that equal_var = False in the scripts in the website. So I'm wondering if the it should be kept that way for all analyses. Or are there situations where equal_var = True?
Hi there Todd, Mark and Jos, I'm learning about SPM1D from the website documentation section and through the repositories appended in GitHub. I have been having trouble understanding the differences between a stacked group (method 1) arrangement and a separated group (method 2) arrangement as mentioned in the website.
I believe the dataset samples from the repositories are linked to some other studies' datasets, and I do sot seem to be able to view them. So I am wondering if there is any sample datasets that shows how the JQ array and J1 array looks like,
I think I may have an idea of how the method 2 arrangement looks like, You see, I tried a One-Way Anova in SPM and used the Method 2 Command :
So I somehow managed to get by the analysis by loading the data using this command :
But as I move on to the repeated measures, I don't think I can continue using method 2 and should re arrange the my data in the method 1 arrangement. That's where I find myself scratching every last square inch of my head.
I can't seem to figure out how method 1 arrangement looks like, and I do not understand how I will be assigning the variables using the command
I would appreciate some explanation and demonstration on the matter as I'd like to figure out how to move forward based on the information into the Two-way and Two-way Repeated-measures ANOVA in SPM for my project later. I look forward to hearing for you. Thanks.