{"id":4628,"date":"2015-05-24T16:08:33","date_gmt":"2015-05-24T21:08:33","guid":{"rendered":"http:\/\/www.thejuliagroup.com\/blog\/?p=4628"},"modified":"2015-05-24T17:18:53","modified_gmt":"2015-05-24T22:18:53","slug":"how-to-write-a-statistical-analysis-paper-step-4","status":"publish","type":"post","link":"https:\/\/www.thejuliagroup.com\/blog\/how-to-write-a-statistical-analysis-paper-step-4\/","title":{"rendered":"How to write a statistical analysis paper: Step 4"},"content":{"rendered":"<p>We&#8217;ve looked at data on Body Mass Index (BMI) by race. Now let&#8217;s take a look at our sample another way. Instead of using BMI as a variable, let&#8217;s use obesity as a dichotomous variable, defined as a BMI greater than 30. It just so happened (really) that this variable was already in the data set so I didn&#8217;t even need to create it.<\/p>\n<p>The code is super-simple and shown below. The reserved SAS keywords are capitalized just to make it easier to spot what must remain the same. \u00a0Let&#8217;s look at this line by line<\/p>\n<p>LIBNAME\u00a0\u00a0mydata &#8220;\/courses\/some123\/c_1234\/&#8221; ACCESS=READONLY;<br \/>\nPROC FREQ DATA\u00a0= mydata.coh602 ;<br \/>\nTABLES\u00a0race*obese \/ CHISQ\u00a0;<br \/>\nWHERE\u00a0race NE\u00a0&#8220;&#8221; ;<br \/>\nRUN\u00a0;<\/p>\n<p>LIBNAME\u00a0\u00a0mydata &#8220;\/courses\/some123\/c_1234\/&#8221; ACCESS=READONLY;<\/p>\n<p>Identifies the directory where the data for your course are stored. As a student, you only have read access.<br \/>\nPROC FREQ DATA\u00a0= mydata.coh602 ;<\/p>\n<p>Begins the frequency procedure, using the data set in the directory linked with mydata in the previous statement.<\/p>\n<p>TABLES\u00a0race*obese \/ CHISQ\u00a0;<\/p>\n<p>Creates a cross-tabulation of race by obesity and the CHISQ following the option statistic produces the second table you see below of chi-square and other statistics that test the hypothesis of a relationship between two categorical variables.<br \/>\nWHERE\u00a0race NE\u00a0&#8220;&#8221; ;<\/p>\n<p>Only selects those observations where we have a value for race (where race is not equal to missing)<br \/>\nRUN\u00a0;<\/p>\n<p>Pretty obvious? Runs the program.<\/p>\n<p><a href=\"http:\/\/www.thejuliagroup.com\/blog\/wp-content\/uploads\/2015\/05\/crosstab1.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-4630\" src=\"http:\/\/www.thejuliagroup.com\/blog\/wp-content\/uploads\/2015\/05\/crosstab1.png\" alt=\"Cross-tabulation of race by obesity\" width=\"350\" height=\"426\" srcset=\"https:\/\/www.thejuliagroup.com\/blog\/wp-content\/uploads\/2015\/05\/crosstab1.png 350w, https:\/\/www.thejuliagroup.com\/blog\/wp-content\/uploads\/2015\/05\/crosstab1-246x300.png 246w\" sizes=\"auto, (max-width: 350px) 100vw, 350px\" \/><\/a><\/p>\n<p>&nbsp;<\/p>\n<p>Similar to our ANOVA results previously, we see that the obesity rates for black and Hispanic samples are similar at 35% and 38% while the proportion of the white population that is obese is 25%. These numbers are the percentage for each row. As is standard practice, a 0 for obesity means no, the respondent is not obese and a 1 means yes, the person is obese.<\/p>\n<p>The CHISQ option produces the table below. The first three statistics are all tests of statistical significance of the relationship between the two variables.\u00a0<a href=\"http:\/\/www.thejuliagroup.com\/blog\/wp-content\/uploads\/2015\/05\/chisq.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-4631\" src=\"http:\/\/www.thejuliagroup.com\/blog\/wp-content\/uploads\/2015\/05\/chisq.png\" alt=\"Table with chi-square statistics\" width=\"399\" height=\"260\" srcset=\"https:\/\/www.thejuliagroup.com\/blog\/wp-content\/uploads\/2015\/05\/chisq.png 399w, https:\/\/www.thejuliagroup.com\/blog\/wp-content\/uploads\/2015\/05\/chisq-300x195.png 300w\" sizes=\"auto, (max-width: 399px) 100vw, 399px\" \/><\/a><\/p>\n<p>You can see from this that there is a statistically significant relationship between race and obesity. Another way to phrase this might be that the distribution of obesity is not the same across races.<\/p>\n<p>The next three statistics give you the size of the relationship. A value of 1.0 denotes perfect agreement (be suspicious if you find that, it&#8217;s more often you coded something wrong than that everyone of one race is different from everyone of another race). A value of 0 indicates no relationship whatsoever between the two variables. Phi and Cramer&#8217;s V range from -1 to +1 , while the contingency coefficient ranges from 0 to 1. The latter seems more reasonable to me since what does a &#8220;negative&#8221; relationship between two categorical variables really mean? Nothing.<\/p>\n<p>From this you can conclude that the relationship between obesity and race is not zero and that it is a fairly small relationship.<\/p>\n<p>Next, I&#8217;d like to look at the odds ratios and also include some multivariate analyses. However, I&#8217;m still sick and some idiot hit my brand new car on the freeway yesterday and sped off, so I am both sick and annoyed. \u00a0So &#8230; I&#8217;m going back to bed and discussion of the next analyses will have to wait until tomorrow.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>We&#8217;ve looked at data on Body Mass Index (BMI) by race. Now let&#8217;s take a look at our sample another way. Instead of using BMI as a variable, let&#8217;s use obesity as a dichotomous variable, defined as a BMI greater than 30. It just so happened (really) that this variable was already in the data&#8230;<\/p>\n","protected":false},"author":5,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_kad_post_transparent":"","_kad_post_title":"","_kad_post_layout":"","_kad_post_sidebar_id":"","_kad_post_content_style":"","_kad_post_vertical_padding":"","_kad_post_feature":"","_kad_post_feature_position":"","_kad_post_header":false,"_kad_post_footer":false,"_kad_post_classname":"","_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[9,11,8],"tags":[],"class_list":["post-4628","post","type-post","status-publish","format-standard","hentry","category-software","category-statistics","category-technology"],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.thejuliagroup.com\/blog\/wp-json\/wp\/v2\/posts\/4628","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.thejuliagroup.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.thejuliagroup.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.thejuliagroup.com\/blog\/wp-json\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/www.thejuliagroup.com\/blog\/wp-json\/wp\/v2\/comments?post=4628"}],"version-history":[{"count":2,"href":"https:\/\/www.thejuliagroup.com\/blog\/wp-json\/wp\/v2\/posts\/4628\/revisions"}],"predecessor-version":[{"id":4634,"href":"https:\/\/www.thejuliagroup.com\/blog\/wp-json\/wp\/v2\/posts\/4628\/revisions\/4634"}],"wp:attachment":[{"href":"https:\/\/www.thejuliagroup.com\/blog\/wp-json\/wp\/v2\/media?parent=4628"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.thejuliagroup.com\/blog\/wp-json\/wp\/v2\/categories?post=4628"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.thejuliagroup.com\/blog\/wp-json\/wp\/v2\/tags?post=4628"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}