My question is how to do T-test for the fMRI data? H1: Condition1 ≠ Condition2Īnd should I compute based on these:1.Difference between the mean intensities of each conditionĢ -1 3 -1 -1 -1 -2 1 2 -3 -> under class 1 stimulus I want to test difference in signal between two conditions(class 1 stimulus vs rest condition), (class 2 stimulus vs rest condition) and (class 3 stimulus vs rest condition). The first two rows are under class 1 stimulus the next two rows are under class 2 stimulus, the next next two rows are under class 3 stimulus, the last three rows are under no stimulus(rest condition). This one is not as hard as it sounds - for example, you could use a for loop to check each entry against a known value.I have a fMRI data matrix, the size of which is 9*10 (I randomly put the value in it). Advanced: Write a script that checks for outliers in your data. Write a script that does everything covered in the statistics tutorials - load a file, generate descriptive statistics, generate plots, and do a statistical test. Use a plot style of your choice but customize it to look good.ģ. Plot the results of the ANOVA above with error bars. It is in the same format as your previous RT data so the commands at the top of this tutorial will help you load it but to be statistically correct you should rename Condition as Group.Ģ. See if you can figure out how to use the anova1 function to analyze this data. It reflects mean reaction time scores for three groups (young, middle, old) on a simple reaction time task. HERE is some data that is more suited for an ANOVA. You will note you get the same output as before, but now we are using ttest2, which is the MATLAB function for an independent samples t-test.Īs I have said, doing inferential statistics in MATLAB is easy.ġ. This would now required an independent samples t-test as a dependent samples t-test is inappropriate. Let's pretend that con1Data is the incongruent data from one group on a Stroop Task and con2Data is the incongruent data from another group on the Stroop Task. This would require a single sample t-test since we do not know the population standard deviation.Īgain, the same variables are returned and you should see this test is not significant. Let's say that for some reason, we now want to compare the condition 1 data to a known population mean of 300. It also returns STATS which holds the t score, the degrees of freedom, and standard error of the mean. It returns the CI of the mean difference. This call returns H, the hypothesis (0 = null true, 1 = alternative true). I have deliberately left the semi-colon off the end so you can see the results in the Command Window. Given the data, this test requires a Paired or Dependent Samples t-test: Let's create two new variables isolating the actual data for a paired samples t-test, each persons mean score for each condition:Ĭon1Data = my_data.RT(my_data.Condition = 1) Ĭon2Data = my_data.RT(my_data.Condition = 2) Based on the literature, we would expect the mean reaction time for Condition 1 to be shorter than the mean reaction time for Condition 2. Recall that this data is simulated data of the Stroop task, wherein Condition 1 is congruent words and Condition 2 is incongruent words. Let's start a new script and go back to our reaction time data. However, I want to emphasize that this tutorial is not designed to teach statistics - it is simply designed to show people who already who know statistics how to run tests in MATLAB. Just as it is easy to plot, it is easy to do inferential statistics in MATLAB.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |