{"id":2177,"date":"2012-03-10T12:23:49","date_gmt":"2012-03-10T17:23:49","guid":{"rendered":"http:\/\/www.thejuliagroup.com\/blog\/?p=2177"},"modified":"2012-03-12T15:21:00","modified_gmt":"2012-03-12T20:21:00","slug":"do-men-want-to-marry-smart-women-an-answer-with-sas-on-demand","status":"publish","type":"post","link":"https:\/\/www.thejuliagroup.com\/blog\/do-men-want-to-marry-smart-women-an-answer-with-sas-on-demand\/","title":{"rendered":"Do Men Want to Marry Smart Women? An Answer with SAS On-Demand"},"content":{"rendered":"<p>Last year, one of my very young doctoral students (who was single), commented in class that she was sure women with more education were less likely to get married. Two older women in the class agreed that was probably true because women with more education were less likely to settle for just any man who came along.<\/p>\n<p>The male students disagreed (as did the rocket scientist). They said that these women were looking at the demand side of the equation in deciding if they got married, but that the SUPPLY side, the number of men who wanted to marry them, increased as women had more education.<\/p>\n<p>A simple way to answer this question is to download the American Community Survey and look at what percentage of women are married by level of education. I talked about these results before but did not explain how I got them.<\/p>\n<p><a href=\"http:\/\/www.census.gov\/acs\/www\/data_documentation\/public_use_microdata_sample\/\">First, got to the U.S. Census website and download the ACS data<\/a>.<br \/>\nSecond, subset the data to only include women over age 18. The age cut-off is up to you but you certainly don&#8217;t want to include all women because children of 8 or 10 aren&#8217;t able to get married and have less than a high school education, so will throw your results off. I also created a categorical variable with four categories, less than high school, high school graduate, college degree and graduate degree. I personally think that relationships between education and other things are not linear. Finishing your fourth year of college and getting your degree is a much bigger difference from your third year than going from two to three years of college. If you don&#8217;t agree with me, do your own analysis. (No, really, I&#8217;m serious.)<\/p>\n<p>In our study, we only used African-American women just because the three women who had started the discussion originally were all African-American and they said,<\/p>\n<blockquote><p>&#8220;Hey, could we look at African-American women?&#8221;<\/p><\/blockquote>\n<p>Sure, why not? \u00a0That&#8217;s the great thing about open data and doing your own statistics, you can look at whatever you want.<\/p>\n<p>Now we have the data set the rest is quite easy. We are going to do two tasks, a Table Analysis and a Bar Chart.<\/p>\n<p>To do the Table Analysis<\/p>\n<p>First, open SAS Enterprise Guide using SAS On-Demand<\/p>\n<p>Second, open the data file you created, which is as simple as going to the FILE menu, selecting OPEN and picking DATA. Then select your data set. It&#8217;s no different than opening in a data set in Excel or Word or anything else. (You youngsters saying, &#8220;So?&#8221; don&#8217;t realize that is not the way SAS has always worked.)<\/p>\n<p>Next, go to Tasks, then Describe then Table Analysis<\/p>\n<p><a href=\"http:\/\/www.thejuliagroup.com\/blog\/wp-content\/uploads\/2012\/03\/tableanalysis1.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-medium wp-image-2179\" title=\"tableanalysis1\" src=\"http:\/\/www.thejuliagroup.com\/blog\/wp-content\/uploads\/2012\/03\/tableanalysis1-300x191.png\" alt=\"Menus to get Table Analysis\" width=\"300\" height=\"191\" srcset=\"https:\/\/www.thejuliagroup.com\/blog\/wp-content\/uploads\/2012\/03\/tableanalysis1-300x191.png 300w, https:\/\/www.thejuliagroup.com\/blog\/wp-content\/uploads\/2012\/03\/tableanalysis1.png 518w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>The window you see below will pop up. In a table analysis, and much of SAS Enterprise Guide in general, the concept of Task roles is important.<\/p>\n<p>&nbsp;<\/p>\n<p>In this case, there are only two roles to worry about. One is the Frequency count. This is the weight variable. Using this will give us an estimate of the total population frequencies. I drag the variable PWGTP under here.<\/p>\n<p><a href=\"http:\/\/www.thejuliagroup.com\/blog\/wp-content\/uploads\/2012\/03\/tableanalysis2.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-medium wp-image-2180\" title=\"tableanalysis2\" src=\"http:\/\/www.thejuliagroup.com\/blog\/wp-content\/uploads\/2012\/03\/tableanalysis2-300x163.png\" alt=\"Task roles\" width=\"300\" height=\"163\" srcset=\"https:\/\/www.thejuliagroup.com\/blog\/wp-content\/uploads\/2012\/03\/tableanalysis2-300x163.png 300w, https:\/\/www.thejuliagroup.com\/blog\/wp-content\/uploads\/2012\/03\/tableanalysis2.png 566w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>The only other role we need for this task is Table variables. Drag the variables married and education under here.<\/p>\n<p>&nbsp;<\/p>\n<p>Next click on the TABLES tab in the window to your life. Drag married and education under Variables permitted in table .<\/p>\n<p><a href=\"http:\/\/www.thejuliagroup.com\/blog\/wp-content\/uploads\/2012\/03\/tableanalysis3.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-medium wp-image-2181\" title=\"tableanalysis3\" src=\"http:\/\/www.thejuliagroup.com\/blog\/wp-content\/uploads\/2012\/03\/tableanalysis3-300x118.png\" alt=\"Select table variables\" width=\"300\" height=\"118\" srcset=\"https:\/\/www.thejuliagroup.com\/blog\/wp-content\/uploads\/2012\/03\/tableanalysis3-300x118.png 300w, https:\/\/www.thejuliagroup.com\/blog\/wp-content\/uploads\/2012\/03\/tableanalysis3.png 739w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>Now drag married to the top of the table and education to the side<\/p>\n<p><a href=\"http:\/\/www.thejuliagroup.com\/blog\/wp-content\/uploads\/2012\/03\/tableanalysis4.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-medium wp-image-2182\" title=\"tableanalysis4\" src=\"http:\/\/www.thejuliagroup.com\/blog\/wp-content\/uploads\/2012\/03\/tableanalysis4-300x141.png\" alt=\"Table with variables assigned\" width=\"300\" height=\"141\" srcset=\"https:\/\/www.thejuliagroup.com\/blog\/wp-content\/uploads\/2012\/03\/tableanalysis4-300x141.png 300w, https:\/\/www.thejuliagroup.com\/blog\/wp-content\/uploads\/2012\/03\/tableanalysis4.png 782w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>Next, click on the CELL STATISTICS tab. Select Row percentages, Column Percentages, Cell frequencies and Include percentages in the data set<\/p>\n<p><a href=\"http:\/\/www.thejuliagroup.com\/blog\/wp-content\/uploads\/2012\/03\/tableanalysis5.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-medium wp-image-2183\" title=\"tableanalysis5\" src=\"http:\/\/www.thejuliagroup.com\/blog\/wp-content\/uploads\/2012\/03\/tableanalysis5-300x277.png\" alt=\"Cell Statistics Window\" width=\"300\" height=\"277\" srcset=\"https:\/\/www.thejuliagroup.com\/blog\/wp-content\/uploads\/2012\/03\/tableanalysis5-300x277.png 300w, https:\/\/www.thejuliagroup.com\/blog\/wp-content\/uploads\/2012\/03\/tableanalysis5.png 371w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>Finally, click on Cell Stat Results under the RESULTS tab. Under the Select tables for cell statistics tab, click the button next to the one table shown.<\/p>\n<p><a href=\"http:\/\/www.thejuliagroup.com\/blog\/wp-content\/uploads\/2012\/03\/tableanalysisCellStat.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-medium wp-image-2184\" title=\"tableanalysisCellStat\" src=\"http:\/\/www.thejuliagroup.com\/blog\/wp-content\/uploads\/2012\/03\/tableanalysisCellStat-300x129.png\" alt=\"Cell Stat results window\" width=\"300\" height=\"129\" srcset=\"https:\/\/www.thejuliagroup.com\/blog\/wp-content\/uploads\/2012\/03\/tableanalysisCellStat-300x129.png 300w, https:\/\/www.thejuliagroup.com\/blog\/wp-content\/uploads\/2012\/03\/tableanalysisCellStat.png 650w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>Click RUN.<\/p>\n<p>This will produce the table below. It is an rtf file because that just happened to be the default for the results in SAS. I highlighted the relevant numbers when I opened the output file in Word. (I exported the output file to my desktop.)<\/p>\n<p><a href=\"http:\/\/www.thejuliagroup.com\/blog\/wp-content\/uploads\/2012\/03\/blogeducationtable.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-medium wp-image-2185\" title=\"blogeducationtable\" src=\"http:\/\/www.thejuliagroup.com\/blog\/wp-content\/uploads\/2012\/03\/blogeducationtable-300x197.png\" alt=\"Education by marriage table\" width=\"300\" height=\"197\" srcset=\"https:\/\/www.thejuliagroup.com\/blog\/wp-content\/uploads\/2012\/03\/blogeducationtable-300x197.png 300w, https:\/\/www.thejuliagroup.com\/blog\/wp-content\/uploads\/2012\/03\/blogeducationtable.png 768w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>As you can see, in fact, the more educated these women were, the MORE likely they were to be married.<\/p>\n<p>Next, I wanted to create a bar chart from these results. This is why I sent the output to a data set, which is what the last two windows &#8211; the including percentages in the data set and the saving the cell statistics did.<\/p>\n<p>However, I have three daughters and two granddaughters waiting to go to brunch with me, since I fall into that graduate degree \/ married cell on the far left.<\/p>\n<p>Tomorrow, assuming my prayers to the god of in-flight wi-fi are answered, I&#8217;ll post how to use this data set to create a bar chart. As my granddaughter says, it is easy-peasy lemon squeezy.<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Last year, one of my very young doctoral students (who was single), commented in class that she was sure women with more education were less likely to get married. Two older women in the class agreed that was probably true because women with more education were less likely to settle for just any man who&#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-2177","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\/2177","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=2177"}],"version-history":[{"count":3,"href":"https:\/\/www.thejuliagroup.com\/blog\/wp-json\/wp\/v2\/posts\/2177\/revisions"}],"predecessor-version":[{"id":2189,"href":"https:\/\/www.thejuliagroup.com\/blog\/wp-json\/wp\/v2\/posts\/2177\/revisions\/2189"}],"wp:attachment":[{"href":"https:\/\/www.thejuliagroup.com\/blog\/wp-json\/wp\/v2\/media?parent=2177"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.thejuliagroup.com\/blog\/wp-json\/wp\/v2\/categories?post=2177"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.thejuliagroup.com\/blog\/wp-json\/wp\/v2\/tags?post=2177"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}