How can I make a graph like this for ANOVA 2-Way
I’m trying to obtain this graph from the example here for my ANOVA data: https://www.mathworks.com/matlabcentral/answers/488962-repeated-measures-anova-matlab?s_tid=srchtitle. However, I am having a hard time understanding the code. This is the code I’ve written for my data so far.
clear
clc
table1 = readtable(‘assignment3simple.xlsx’);
table1matrix = table1{:,2:7};
anova2(table1matrix, 2)
figure;
boxplot(table1matrix,{’20°C’, ’30°C’, ’40°C’, ’50°C’, ’60°C’, ’70°C’})
xlabel(‘Operating Temperature’);
ylabel(‘Power Output (w)’);
title(‘Box Plot of Power Output at Different Operating Temperatures’);
I’ve already got the graph for the interaction but getting the individual one is confusing me. Any help would be greatly appreciated. Thank you.
Note: This is the code used for the figure. (I am not using the same data, just trying to understand the code and apply it to mine)
bpdata = [];
for i = 1:max(Q2.PATIENT) %assuming patient numbers are 1:max
bpdata = [bpdata, Q2{Q2.PATIENT==i,3:8},nan(size(unique(Q2.TREAT)))];
end
figure()
boxplot(bpdata)
arrayfun(@xline,7:7:size(bpdata,2))
xlabel(‘6 treatment times across 11 patients’)
ylabel(‘measurement value’)
title(‘Data pooled between treatment factors’)
set(gca,’XTick’, [])
(Courtesy of Adam Danz)I’m trying to obtain this graph from the example here for my ANOVA data: https://www.mathworks.com/matlabcentral/answers/488962-repeated-measures-anova-matlab?s_tid=srchtitle. However, I am having a hard time understanding the code. This is the code I’ve written for my data so far.
clear
clc
table1 = readtable(‘assignment3simple.xlsx’);
table1matrix = table1{:,2:7};
anova2(table1matrix, 2)
figure;
boxplot(table1matrix,{’20°C’, ’30°C’, ’40°C’, ’50°C’, ’60°C’, ’70°C’})
xlabel(‘Operating Temperature’);
ylabel(‘Power Output (w)’);
title(‘Box Plot of Power Output at Different Operating Temperatures’);
I’ve already got the graph for the interaction but getting the individual one is confusing me. Any help would be greatly appreciated. Thank you.
Note: This is the code used for the figure. (I am not using the same data, just trying to understand the code and apply it to mine)
bpdata = [];
for i = 1:max(Q2.PATIENT) %assuming patient numbers are 1:max
bpdata = [bpdata, Q2{Q2.PATIENT==i,3:8},nan(size(unique(Q2.TREAT)))];
end
figure()
boxplot(bpdata)
arrayfun(@xline,7:7:size(bpdata,2))
xlabel(‘6 treatment times across 11 patients’)
ylabel(‘measurement value’)
title(‘Data pooled between treatment factors’)
set(gca,’XTick’, [])
(Courtesy of Adam Danz) I’m trying to obtain this graph from the example here for my ANOVA data: https://www.mathworks.com/matlabcentral/answers/488962-repeated-measures-anova-matlab?s_tid=srchtitle. However, I am having a hard time understanding the code. This is the code I’ve written for my data so far.
clear
clc
table1 = readtable(‘assignment3simple.xlsx’);
table1matrix = table1{:,2:7};
anova2(table1matrix, 2)
figure;
boxplot(table1matrix,{’20°C’, ’30°C’, ’40°C’, ’50°C’, ’60°C’, ’70°C’})
xlabel(‘Operating Temperature’);
ylabel(‘Power Output (w)’);
title(‘Box Plot of Power Output at Different Operating Temperatures’);
I’ve already got the graph for the interaction but getting the individual one is confusing me. Any help would be greatly appreciated. Thank you.
Note: This is the code used for the figure. (I am not using the same data, just trying to understand the code and apply it to mine)
bpdata = [];
for i = 1:max(Q2.PATIENT) %assuming patient numbers are 1:max
bpdata = [bpdata, Q2{Q2.PATIENT==i,3:8},nan(size(unique(Q2.TREAT)))];
end
figure()
boxplot(bpdata)
arrayfun(@xline,7:7:size(bpdata,2))
xlabel(‘6 treatment times across 11 patients’)
ylabel(‘measurement value’)
title(‘Data pooled between treatment factors’)
set(gca,’XTick’, [])
(Courtesy of Adam Danz) anova, statistics, matlab MATLAB Answers — New Questions