{"id":909,"date":"2025-06-02T11:42:11","date_gmt":"2025-06-02T03:42:11","guid":{"rendered":"http:\/\/www.rfnirs.com\/?p=909"},"modified":"2025-06-02T11:49:23","modified_gmt":"2025-06-02T03:49:23","slug":"%e3%80%90%e5%b0%8ftip%e3%80%91matlab%e4%b8%adt%e6%a3%80%e9%aa%8c%e5%92%8c%e7%a7%a9%e5%92%8c%e6%a3%80%e9%aa%8c%e7%9a%84p%e5%92%8ch%e4%bd%8d%e7%bd%ae%e6%98%af%e7%9b%b8%e5%8f%8d%e7%9a%84","status":"publish","type":"post","link":"http:\/\/www.rfnirs.com\/index.php\/2025\/06\/02\/%e3%80%90%e5%b0%8ftip%e3%80%91matlab%e4%b8%adt%e6%a3%80%e9%aa%8c%e5%92%8c%e7%a7%a9%e5%92%8c%e6%a3%80%e9%aa%8c%e7%9a%84p%e5%92%8ch%e4%bd%8d%e7%bd%ae%e6%98%af%e7%9b%b8%e5%8f%8d%e7%9a%84\/","title":{"rendered":"\u3010\u5c0fTip\u3011Matlab\u4e2dt\u68c0\u9a8c\u548c\u79e9\u548c\u68c0\u9a8c\u7684P\u548cH\u4f4d\u7f6e\u662f\u76f8\u53cd\u7684"},"content":{"rendered":"\t\t<div data-elementor-type=\"wp-post\" data-elementor-id=\"909\" class=\"elementor elementor-909\">\n\t\t\t\t<div class=\"elementor-element elementor-element-c772d0e e-flex e-con-boxed e-con e-parent\" data-id=\"c772d0e\" data-element_type=\"container\">\n\t\t\t\t\t<div class=\"e-con-inner\">\n\t\t\t\t<div class=\"elementor-element elementor-element-581c053 elementor-widget elementor-widget-text-editor\" data-id=\"581c053\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t<style>\/*! elementor - v3.21.0 - 30-04-2024 *\/\n.elementor-widget-text-editor.elementor-drop-cap-view-stacked .elementor-drop-cap{background-color:#69727d;color:#fff}.elementor-widget-text-editor.elementor-drop-cap-view-framed .elementor-drop-cap{color:#69727d;border:3px solid;background-color:transparent}.elementor-widget-text-editor:not(.elementor-drop-cap-view-default) .elementor-drop-cap{margin-top:8px}.elementor-widget-text-editor:not(.elementor-drop-cap-view-default) .elementor-drop-cap-letter{width:1em;height:1em}.elementor-widget-text-editor .elementor-drop-cap{float:left;text-align:center;line-height:1;font-size:50px}.elementor-widget-text-editor .elementor-drop-cap-letter{display:inline-block}<\/style>\t\t\t\t<p>\u00a0<\/p><p>Matlab\u4e2dt\u68c0\u9a8c\u51fd\u6570\uff1a<a style=\"color: #1171be; font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; font-size: 13px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; text-wrap-mode: nowrap; background-color: #fcfcfc;\" href=\"https:\/\/www.mathworks.com\/help\/stats\/ttest2.html?searchHighlight=ttest&amp;s_tid=srchtitle_support_results_2_ttest#d126e1219657\">[h,p,ci,stats] = ttest2(<span style=\"padding-right: 3px; padding-left: 3px; font-size: 8.97px; display: inline-block; font-weight: bold;\">___<\/span>)<\/a><\/p><p><span style=\"font-family: Roboto, sans-serif; font-size: 14px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400;\">Matlab\u4e2d\u79e9\u548c\u68c0\u9a8c\u51fd\u6570\uff1a<\/span><a style=\"color: #1171be; font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; font-size: 13px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; text-wrap-mode: nowrap; background-color: #fcfcfc;\" href=\"https:\/\/www.mathworks.com\/help\/stats\/ranksum.html#d126e1047290\">[p,h,stats] = ranksum(x,y)<\/a><\/p><p>\u53ef\u4ee5\u53d1\u73b0\u4e24\u8005h\u548cp\u7684\u4f4d\u7f6e\u521a\u597d\u76f8\u53cd\u3002<\/p><p>\u4e4b\u524d\u5199\u4ee3\u7801\u7406\u6240\u5f53\u7136\u8ba4\u4e3a\u5047\u8bbe\u68c0\u9a8c\u7684\u4ee3\u7801\u7ed3\u6784\u5e94\u8be5\u662f\u7c7b\u4f3c\u7684\uff0c\u5b9e\u9645\u5e76\u4e0d\u662f\u8fd9\u6837\u3002<\/p><p>\u4f7f\u7528\u4ee3\u7801\u9700\u8981\u8c28\u614e\u3002<\/p><p>\u00a0<\/p><p>\u4ee5\u4e0b\u662fDeepseek\u5217\u4e3e\u7684Matlab\u4e2d\u5e38\u7528\u5047\u8bbe\u68c0\u9a8c\u7684\u51fd\u6570\uff1a<\/p><h3><strong>1. \u53c2\u6570\u68c0\u9a8c\uff08\u5047\u5b9a\u6570\u636e\u670d\u4ece\u7279\u5b9a\u5206\u5e03\uff0c\u5982\u6b63\u6001\u5206\u5e03\uff09<\/strong><\/h3><h4><strong>(1) t\u68c0\u9a8c<\/strong><\/h4><ul><li><p class=\"ds-markdown-paragraph\"><strong>\u5355\u6837\u672ct\u68c0\u9a8c<\/strong>\uff1a\u68c0\u9a8c\u5355\u4e2a\u6837\u672c\u5747\u503c\u662f\u5426\u7b49\u4e8e\u7ed9\u5b9a\u503c<br \/><code>[h, p, ci, stats] = ttest(x, mu)<\/code><br \/>\uff08<code>x<\/code>\uff1a\u6570\u636e\u5411\u91cf\uff1b<code>mu<\/code>\uff1a\u5047\u8bbe\u7684\u5747\u503c\uff09<\/p><\/li><li><p class=\"ds-markdown-paragraph\"><strong>\u72ec\u7acb\u53cc\u6837\u672ct\u68c0\u9a8c<\/strong>\uff1a\u68c0\u9a8c\u4e24\u4e2a\u72ec\u7acb\u6837\u672c\u5747\u503c\u662f\u5426\u76f8\u7b49<br \/><code>[h, p, ci, stats] = ttest2(x, y)<\/code><br \/>\uff08\u9ed8\u8ba4\u5047\u8bbe\u65b9\u5dee\u9f50\u6027\uff1b\u6dfb\u52a0\u9009\u9879\u00a0<code>'Vartype','unequal'<\/code>\u00a0\u5904\u7406\u65b9\u5dee\u4e0d\u9f50\uff09<\/p><\/li><li><p class=\"ds-markdown-paragraph\"><strong>\u914d\u5bf9\u6837\u672ct\u68c0\u9a8c<\/strong>\uff1a\u68c0\u9a8c\u4e24\u4e2a\u76f8\u5173\u6837\u672c\u7684\u5747\u503c\u5dee<br \/><code>[h, p, ci, stats] = ttest(x, y)<\/code><br \/>\uff08<code>x<\/code>,\u00a0<code>y<\/code>\u00a0\u4e3a\u914d\u5bf9\u89c2\u6d4b\u503c\uff09<\/p><\/li><\/ul><h4><strong>(2) z\u68c0\u9a8c<\/strong><\/h4><ul><li><p class=\"ds-markdown-paragraph\"><strong>\u5355\u6837\u672cz\u68c0\u9a8c<\/strong>\uff1a\u5df2\u77e5\u603b\u4f53\u6807\u51c6\u5dee\u65f6\uff0c\u68c0\u9a8c\u6837\u672c\u5747\u503c<br \/><code>[h, p, ci, zval] = ztest(x, mu, sigma)<\/code><br \/>\uff08<code>sigma<\/code>\uff1a\u603b\u4f53\u6807\u51c6\u5dee\uff09<\/p><\/li><\/ul><h4><strong>(3) \u65b9\u5dee\u5206\u6790 (ANOVA)<\/strong><\/h4><ul><li><p class=\"ds-markdown-paragraph\"><strong>\u5355\u56e0\u7d20ANOVA<\/strong>\uff1a\u68c0\u9a8c\u591a\u4e2a\u72ec\u7acb\u7ec4\u7684\u5747\u503c\u662f\u5426\u76f8\u7b49<br \/><code>p = anova1(X, group)<\/code><br \/>\uff08<code>X<\/code>\uff1a\u6570\u636e\u5411\u91cf\uff1b<code>group<\/code>\uff1a\u5206\u7ec4\u6807\u7b7e\uff09<\/p><\/li><li><p class=\"ds-markdown-paragraph\"><strong>\u53cc\u56e0\u7d20ANOVA<\/strong>\uff1a\u68c0\u9a8c\u4e24\u4e2a\u56e0\u7d20\u5bf9\u89c2\u6d4b\u503c\u7684\u5f71\u54cd<br \/><code>p = anova2(X, reps)<\/code><br \/>\uff08<code>reps<\/code>\uff1a\u6bcf\u4e2a\u5355\u5143\u7684\u91cd\u590d\u89c2\u6d4b\u6b21\u6570\uff09<\/p><\/li><\/ul><h4><strong>(4) \u5361\u65b9\u68c0\u9a8c<\/strong><\/h4><ul><li><p class=\"ds-markdown-paragraph\"><strong>\u62df\u5408\u4f18\u5ea6\u68c0\u9a8c<\/strong>\uff1a\u68c0\u9a8c\u6837\u672c\u662f\u5426\u670d\u4ece\u7279\u5b9a\u5206\u5e03<br \/><code>[h, p, stats] = chi2gof(x, 'CDF', pd)<\/code><br \/>\uff08<code>pd<\/code>\uff1a\u6982\u7387\u5206\u5e03\u5bf9\u8c61\uff0c\u5982\u00a0<code>makedist('Normal')<\/code>\uff09<\/p><\/li><li><p class=\"ds-markdown-paragraph\"><strong>\u72ec\u7acb\u6027\u68c0\u9a8c<\/strong>\uff1a\u68c0\u9a8c\u5217\u8054\u8868\u4e2d\u53d8\u91cf\u7684\u72ec\u7acb\u6027<br \/><code>[tbl, chi2, p] = crosstab(x1, x2)<\/code><br \/>\uff08\u8f93\u51fa\u5361\u65b9\u7edf\u8ba1\u91cf\u00a0<code>chi2<\/code>\u00a0\u548c p\u503c\u00a0<code>p<\/code>\uff09<\/p><\/li><\/ul><hr \/><h3><strong>2. \u975e\u53c2\u6570\u68c0\u9a8c\uff08\u4e0d\u4f9d\u8d56\u6570\u636e\u5206\u5e03\u5047\u8bbe\uff09<\/strong><\/h3><h4><strong>(1) Wilcoxon \u68c0\u9a8c<\/strong><\/h4><ul><li><p class=\"ds-markdown-paragraph\"><strong>\u7b26\u53f7\u79e9\u68c0\u9a8c\uff08\u5355\u6837\u672c\/\u914d\u5bf9\u6837\u672c\uff09<\/strong>\uff1a\u68c0\u9a8c\u4e2d\u4f4d\u6570\u662f\u5426\u7b49\u4e8e\u7ed9\u5b9a\u503c<br \/><code>[p, h] = signrank(x, m)<\/code><br \/>\uff08<code>m<\/code>\uff1a\u5047\u8bbe\u7684\u4e2d\u4f4d\u6570\uff1b\u914d\u5bf9\u65f6\u00a0<code>signrank(x-y, 0)<\/code>\uff09<\/p><\/li><li><p class=\"ds-markdown-paragraph\"><strong>\u79e9\u548c\u68c0\u9a8c\uff08\u72ec\u7acb\u53cc\u6837\u672c\uff09<\/strong>\uff1aMann-Whitney U \u68c0\u9a8c<br \/><code>[p, h] = ranksum(x, y)<\/code><\/p><\/li><\/ul><h4><strong>(2) Kruskal-Wallis \u68c0\u9a8c<\/strong><\/h4><ul><li><p class=\"ds-markdown-paragraph\"><strong>\u591a\u7ec4\u72ec\u7acb\u6837\u672c\u4e2d\u4f4d\u6570\u6bd4\u8f83<\/strong><br \/><code>p = kruskalwallis(X, group)<\/code><\/p><\/li><\/ul><h4><strong>(3) Friedman \u68c0\u9a8c<\/strong><\/h4><ul><li><p class=\"ds-markdown-paragraph\"><strong>\u591a\u7ec4\u76f8\u5173\u6837\u672c\u4e2d\u4f4d\u6570\u6bd4\u8f83<\/strong><br \/><code>p = friedman(X, reps)<\/code><\/p><\/li><\/ul><h4><strong>(4) Kolmogorov-Smirnov \u68c0\u9a8c<\/strong><\/h4><ul><li><p class=\"ds-markdown-paragraph\"><strong>\u5355\u6837\u672c\u5206\u5e03\u68c0\u9a8c<\/strong>\uff1a\u68c0\u9a8c\u6570\u636e\u662f\u5426\u670d\u4ece\u6307\u5b9a\u5206\u5e03<br \/><code>[h, p] = kstest(x, 'CDF', dist)<\/code><\/p><\/li><li><p class=\"ds-markdown-paragraph\"><strong>\u53cc\u6837\u672c\u540c\u5206\u5e03\u68c0\u9a8c<\/strong>\uff1a\u68c0\u9a8c\u4e24\u6837\u672c\u662f\u5426\u6765\u81ea\u540c\u4e00\u5206\u5e03<br \/><code>[h, p] = kstest2(x, y)<\/code><\/p><\/li><\/ul><hr \/><h3><strong>3. \u6b63\u6001\u6027\u68c0\u9a8c<\/strong><\/h3><ul><li><p class=\"ds-markdown-paragraph\"><strong>Lilliefors \u68c0\u9a8c<\/strong>\uff08\u6539\u8fdb\u7684KS\u68c0\u9a8c\uff0c\u9002\u7528\u4e8e\u6b63\u6001\u5206\u5e03\u53c2\u6570\u672a\u77e5\uff09<br \/><code>[h, p] = lillietest(x)<\/code><\/p><\/li><li><p class=\"ds-markdown-paragraph\"><strong>Jarque-Bera \u68c0\u9a8c<\/strong>\uff08\u57fa\u4e8e\u504f\u5ea6\u548c\u5cf0\u5ea6\uff09<br \/><code>[h, p] = jbtest(x)<\/code><\/p><\/li><\/ul><hr \/><h3><strong>4. \u65b9\u5dee\u9f50\u6027\u68c0\u9a8c<\/strong><\/h3><ul><li><p class=\"ds-markdown-paragraph\"><strong>Bartlett \u68c0\u9a8c<\/strong>\uff08\u5047\u8bbe\u6b63\u6001\u5206\u5e03\uff09<br \/><code>p = vartestn(X, group)<\/code><\/p><\/li><li><p class=\"ds-markdown-paragraph\"><strong>Levene \u68c0\u9a8c<\/strong>\uff08\u5bf9\u975e\u6b63\u6001\u5206\u5e03\u7a33\u5065\uff09<br \/><code>p = vartestn(X, group, 'TestType','LeveneAbsolute')<\/code><\/p><\/li><\/ul>\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t","protected":false},"excerpt":{"rendered":"<p>\u00a0 Matlab\u4e2dt\u68c0\u9a8c\u51fd\u6570\uff1a[h,p,ci,stats] = ttest2(___) Matlab\u4e2d\u79e9\u548c\u68c0\u9a8c [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"ocean_post_layout":"","ocean_both_sidebars_style":"","ocean_both_sidebars_content_width":0,"ocean_both_sidebars_sidebars_width":0,"ocean_sidebar":"","ocean_second_sidebar":"","ocean_disable_margins":"enable","ocean_add_body_class":"","ocean_shortcode_before_top_bar":"","ocean_shortcode_after_top_bar":"","ocean_shortcode_before_header":"","ocean_shortcode_after_header":"","ocean_has_shortcode":"","ocean_shortcode_after_title":"","ocean_shortcode_before_footer_widgets":"","ocean_shortcode_after_footer_widgets":"","ocean_shortcode_before_footer_bottom":"","ocean_shortcode_after_footer_bottom":"","ocean_display_top_bar":"default","ocean_display_header":"default","ocean_header_style":"","ocean_center_header_left_menu":"","ocean_custom_header_template":"","ocean_custom_logo":0,"ocean_custom_retina_logo":0,"ocean_custom_logo_max_width":0,"ocean_custom_logo_tablet_max_width":0,"ocean_custom_logo_mobile_max_width":0,"ocean_custom_logo_max_height":0,"ocean_custom_logo_tablet_max_height":0,"ocean_custom_logo_mobile_max_height":0,"ocean_header_custom_menu":"","ocean_menu_typo_font_family":"","ocean_menu_typo_font_subset":"","ocean_menu_typo_font_size":0,"ocean_menu_typo_font_size_tablet":0,"ocean_menu_typo_font_size_mobile":0,"ocean_menu_typo_font_size_unit":"px","ocean_menu_typo_font_weight":"","ocean_menu_typo_font_weight_tablet":"","ocean_menu_typo_font_weight_mobile":"","ocean_menu_typo_transform":"","ocean_menu_typo_transform_tablet":"","ocean_menu_typo_transform_mobile":"","ocean_menu_typo_line_height":0,"ocean_menu_typo_line_height_tablet":0,"ocean_menu_typo_line_height_mobile":0,"ocean_menu_typo_line_height_unit":"","ocean_menu_typo_spacing":0,"ocean_menu_typo_spacing_tablet":0,"ocean_menu_typo_spacing_mobile":0,"ocean_menu_typo_spacing_unit":"","ocean_menu_link_color":"","ocean_menu_link_color_hover":"","ocean_menu_link_color_active":"","ocean_menu_link_background":"","ocean_menu_link_hover_background":"","ocean_menu_link_active_background":"","ocean_menu_social_links_bg":"","ocean_menu_social_hover_links_bg":"","ocean_menu_social_links_color":"","ocean_menu_social_hover_links_color":"","ocean_disable_title":"default","ocean_disable_heading":"default","ocean_post_title":"","ocean_post_subheading":"","ocean_post_title_style":"","ocean_post_title_background_color":"","ocean_post_title_background":0,"ocean_post_title_bg_image_position":"","ocean_post_title_bg_image_attachment":"","ocean_post_title_bg_image_repeat":"","ocean_post_title_bg_image_size":"","ocean_post_title_height":0,"ocean_post_title_bg_overlay":0.5,"ocean_post_title_bg_overlay_color":"","ocean_disable_breadcrumbs":"default","ocean_breadcrumbs_color":"","ocean_breadcrumbs_separator_color":"","ocean_breadcrumbs_links_color":"","ocean_breadcrumbs_links_hover_color":"","ocean_display_footer_widgets":"default","ocean_display_footer_bottom":"default","ocean_custom_footer_template":"","ocean_post_oembed":"","ocean_post_self_hosted_media":"","ocean_post_video_embed":"","ocean_link_format":"","ocean_link_format_target":"self","ocean_quote_format":"","ocean_quote_format_link":"post","ocean_gallery_link_images":"on","ocean_gallery_id":[],"footnotes":""},"categories":[6],"tags":[],"class_list":["post-909","post","type-post","status-publish","format-standard","hentry","category-fnirs","entry"],"_links":{"self":[{"href":"http:\/\/www.rfnirs.com\/index.php\/wp-json\/wp\/v2\/posts\/909","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.rfnirs.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.rfnirs.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.rfnirs.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.rfnirs.com\/index.php\/wp-json\/wp\/v2\/comments?post=909"}],"version-history":[{"count":7,"href":"http:\/\/www.rfnirs.com\/index.php\/wp-json\/wp\/v2\/posts\/909\/revisions"}],"predecessor-version":[{"id":916,"href":"http:\/\/www.rfnirs.com\/index.php\/wp-json\/wp\/v2\/posts\/909\/revisions\/916"}],"wp:attachment":[{"href":"http:\/\/www.rfnirs.com\/index.php\/wp-json\/wp\/v2\/media?parent=909"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.rfnirs.com\/index.php\/wp-json\/wp\/v2\/categories?post=909"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.rfnirs.com\/index.php\/wp-json\/wp\/v2\/tags?post=909"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}