2 way repeated measures anova
조회 수: 26 (최근 30일)
이전 댓글 표시
Hi everyone,
I have data of firing responses of 6 neurons for 7 different current injections (20:20:140), before and after the application of a drug.
So basically every neuron has 14 measurements.
What is the correct way to perform two way repeated measurs anova test to find out the drug effect?
Thank you!
댓글 수: 0
답변 (1개)
Shivansh
2024년 3월 20일
Hi Ben!
It seems that you want to perform a two-way repeated measures ANOVA in MATLAB to analyze the effects of drug application on the firing responses of neurons across different current injections. You will need to structure your data appropriately and use the "fitrm" and "ranova" functions.
I have provided a sample MATLAB code that performs the ANOVA analysis on the given data:
% Read the data from the Excel file
filename = 'Data_anova.xlsx';
data = readtable(filename);
% Handle NaN values - for simplicity, removing any rows with NaN values.
data = rmmissing(data);
% Convert categorical variables
data.cell_ID = categorical(data.cell_ID);
data.condition = categorical(data.condition);
% Fit the repeated measures model without explicitly specifying 'WithinDesign'
rm = fitrm(data, 'x_20_,x_40_,x_60_,x_80_,x_100_,x_120_,x_140_~condition');
% Perform the repeated measures ANOVA
ranovatbl = ranova(rm);
% Display the results
disp(ranovatbl);
The above code demonstrates a simple approach for repeated measures ANOVA analysis. You can try modifying the above approach by reshaping the data table to have one data point in one row and performing two-way repeated measures ANOVA in MATLAB.
You can refer to the following documentations for more information:
I hope it helps!
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Repeated Measures and MANOVA에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!