{"id":1095,"date":"2018-08-18T16:15:17","date_gmt":"2018-08-18T20:15:17","guid":{"rendered":"http:\/\/www.kaikaichen.com\/?p=1095"},"modified":"2023-08-01T20:45:07","modified_gmt":"2023-08-02T00:45:07","slug":"stata-command-to-test-equality-of-mean-and-median","status":"publish","type":"post","link":"https:\/\/www.kaichen.work\/?p=1095","title":{"rendered":"Stata command to test equality of mean and median"},"content":{"rendered":"\n<table id=\"tablepress-6\" class=\"tablepress tablepress-id-6\">\n<thead>\n<tr class=\"row-1\">\n\t<th class=\"column-1\">Data<\/th><th class=\"column-2\">Command to Test Equality of Mean<\/th><th class=\"column-3\">Command to Test Equality of Median<\/th>\n<\/tr>\n<\/thead>\n<tbody class=\"row-striping row-hover\">\n<tr class=\"row-2\">\n\t<td class=\"column-1\">Paired or matched<\/td><td class=\"column-2\">Paired t test:<br \/>\n<code><strong>ttest var1 = var2<\/strong><\/code><\/td><td class=\"column-3\">Wilcoxon matched-pairs signed-rank test:<br \/>\n<code><strong>signrank var1 = var2<\/strong><\/code><br \/>\n<br \/>\nSign test of matched pairs:<br \/>\n<code><strong>signtest var1 = var2<\/strong><\/code><\/td>\n<\/tr>\n<tr class=\"row-3\">\n\t<td class=\"column-1\">Unpaired or unmatched<\/td><td class=\"column-2\">Two-sample t test:<br \/>\n<code><strong>ttest var, by(groupvar)<\/strong><\/code><\/td><td class=\"column-3\">Wilcoxon rank-sum test or Mann_Whitney test:<br \/>\n<code><strong>ranksum var, by(groupvar)<\/strong><\/code><br \/>\n<br \/>\nK-sample equality-of-medians test:<br \/>\n<code><strong>median var, by(groupvar)<\/strong><\/code><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<!-- #tablepress-6 from cache -->\n<p>Please read <a href=\"http:\/\/www.kaichen.work\/?p=1218\" target=\"_blank\" rel=\"noopener noreferrer\">this post<\/a> for how to display the results in a ready-for-use format.<\/p>\n<p>UCLA IDRE has posted an\u00a0article (<a href=\"https:\/\/stats.idre.ucla.edu\/stata\/whatstat\/what-statistical-analysis-should-i-usestatistical-analyses-using-stata\/\" target=\"_blank\" rel=\"noopener noreferrer\">link<\/a>) that may provide a bit more explanation.\u00a0UCLA IDRE is a great resource for learning statistical analysis. A big thank you to them.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Please read this post for how to display the results in a ready-for-use format. UCLA IDRE has posted an\u00a0article (link) that may provide a bit more explanation.\u00a0UCLA IDRE is a great resource for learning statistical analysis. A big thank you &hellip; <a href=\"https:\/\/www.kaichen.work\/?p=1095\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[9],"tags":[],"_links":{"self":[{"href":"https:\/\/www.kaichen.work\/index.php?rest_route=\/wp\/v2\/posts\/1095"}],"collection":[{"href":"https:\/\/www.kaichen.work\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.kaichen.work\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.kaichen.work\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.kaichen.work\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1095"}],"version-history":[{"count":8,"href":"https:\/\/www.kaichen.work\/index.php?rest_route=\/wp\/v2\/posts\/1095\/revisions"}],"predecessor-version":[{"id":2173,"href":"https:\/\/www.kaichen.work\/index.php?rest_route=\/wp\/v2\/posts\/1095\/revisions\/2173"}],"wp:attachment":[{"href":"https:\/\/www.kaichen.work\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1095"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.kaichen.work\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1095"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.kaichen.work\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1095"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}