这是正确的方法来确定方差吗?计算函数,假定值和方差。

32视图(30天)
clc;%清除命令窗口。
关闭所有;%关闭所有数据(除了imtool。)
清晰;%擦掉所有现有的变量。或者clearvars如果你想要的。
工作空间;%确定工作区面板显示。
%加载特性矩阵
feature1 =负载(“feature1.mat”);
feature2 =负载(“feature2.mat”);
feature3 =负载(“feature3.mat”);
feature4 =负载(“feature4.mat”);
feature5 =负载(“feature5.mat”);
feature6 =负载(“feature6.mat”);
%将前两个结构结合到一个结构体
(feature1 mouse1 =。特性,feature2.features];
%将接下来的两个结构结合到一个结构体
(feature3 mouse2 =。特性,feature4.features];
%将最后两个结构结合到一个结构体
(feature5 mouse3 =。特性,feature6.features];
%提取字段
% mouse1 profilecounts
profileCounts1 = [mouse1 (1) .profileCounts;mouse1 (2) .profileCounts;mouse1 (3) .profileCounts;mouse1 (4) .profileCounts;mouse1 (5) .profileCounts;mouse1 (6) .profileCounts];
% mouse2 profilecounts
profileCounts2 = [mouse2 (1) .profileCounts;mouse2 (2) .profileCounts;mouse2 (3) .profileCounts;mouse2 (4) .profileCounts;mouse2 (5) .profileCounts;mouse2 (6) .profileCounts];
% % mouse3 profilecounts
profileCounts3 = [mouse3 (1) .profileCounts;mouse3 (2) .profileCounts;mouse3 (3) .profileCounts;mouse3 (4) .profileCounts;mouse3 (5) .profileCounts;mouse3 (6) .profileCounts];
%连接profileCounts每组
%计算组之间的差异
var_between_groups = var ([profileCounts1;profileCounts2;profileCounts3]);
%计算群野生的自由度
df_between_groups = 2;%的数量- 1组
df_within_groups =长度(profileCounts1) + (profileCounts2) +长度(profileCounts3) - 3;%的总数量的观察-组的数量
%计算每组内方差
var_within_groups = (var (profileCounts1) *(长度(profileCounts1) 1) + var (profileCounts2) *(长度(profileCounts2) 1) + var (profileCounts3) *(长度(profileCounts3) 1)) /(长度(profileCounts1) +长度(profileCounts2) + (profileCounts3) - 3);
%计算组之间的差异
var_between_groups = var ([profileCounts1;profileCounts2;profileCounts3]);
%计算f统计量
F_statistic = var_between_groups / var_within_groups;
%计算自由度
df_between_groups = 2 - 1;
df_within_groups =长度(profileCounts1) + (profileCounts2) +长度(profileCounts3) - 3;
%计算假定值
p_value = 1 - fcdf (F_statistic、df_between_groups df_within_groups);
%确定组之间的差异是显著的
如果p_value < 0.05
disp (组之间的差异是显著的);
其他的
disp (组之间的差异是不显著的);
结束
4评论
克里斯·拉皮埃尔
克里斯·拉皮埃尔 alrededor de 12小时前
编辑:克里斯·拉皮埃尔 alrededor de 15小时前
你不分享你的垫子文件,目的是给别人来找到它们。你现在提供的链接在你的评论,所以我删除了国旗。

登录置评。

答案(0)


翻译的