<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Correlation Showing Missing Relationships in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Correlation-Showing-Missing-Relationships/m-p/837450#M82119</link>
    <description>&lt;P&gt;I am trying to do a correlation matrix between the missingness of different variables. For instance, how often/what's the correlation that gender and ethnicity are missing together. How would I go about this? I know how to do a correlation matrix between variables, but a little stuck on how to compare the missingness of each variable. Thanks!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 07 Oct 2022 18:40:18 GMT</pubDate>
    <dc:creator>brownster</dc:creator>
    <dc:date>2022-10-07T18:40:18Z</dc:date>
    <item>
      <title>Correlation Showing Missing Relationships</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Correlation-Showing-Missing-Relationships/m-p/837450#M82119</link>
      <description>&lt;P&gt;I am trying to do a correlation matrix between the missingness of different variables. For instance, how often/what's the correlation that gender and ethnicity are missing together. How would I go about this? I know how to do a correlation matrix between variables, but a little stuck on how to compare the missingness of each variable. Thanks!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 07 Oct 2022 18:40:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Correlation-Showing-Missing-Relationships/m-p/837450#M82119</guid>
      <dc:creator>brownster</dc:creator>
      <dc:date>2022-10-07T18:40:18Z</dc:date>
    </item>
    <item>
      <title>Re: Correlation Showing Missing Relationships</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Correlation-Showing-Missing-Relationships/m-p/837454#M82121</link>
      <description>&lt;P&gt;I think you are looking at association not correlation. Correlation is a specific calculation.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;One way may be to look at distribution such as in proc freq. Create a format for non-missing / missing.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;An example:&lt;/P&gt;
&lt;PRE&gt;proc format ;
value nm
. = 'Missing'
other='Not missing'
;
/*if the variable is charcter*/
value $nm
' '= 'Missing'
other='Not missing'
;

data example;
   input age sex $;
datalines;
25 f
21 m
.  f
.  f
25 .
30 .
35 .
;

proc freq data=example;
   tables age*sex / missing;
   format age nm. sex $nm. ;
run;&lt;/PRE&gt;
&lt;P&gt;The above is the examine the data. You could do a chi-square test for actual difference of distribution, some difference or odds ratios and relative risks as well.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Or don't format the variables if they have a small number of values and just use the MISSING option in the Tables statement so the missing values are considered.&lt;/P&gt;</description>
      <pubDate>Fri, 07 Oct 2022 19:16:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Correlation-Showing-Missing-Relationships/m-p/837454#M82121</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2022-10-07T19:16:21Z</dc:date>
    </item>
    <item>
      <title>Re: Correlation Showing Missing Relationships</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Correlation-Showing-Missing-Relationships/m-p/837458#M82122</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;ods select MissPattern;
proc mi data=Sashelp.Heart nimpute=0;
var AgeAtStart Height Weight Diastolic 
    Systolic MRW Smoking Cholesterol;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;A href="https://blogs.sas.com/content/iml/2016/04/18/patterns-of-missing-data-in-sas.html" target="_blank"&gt;https://blogs.sas.com/content/iml/2016/04/18/patterns-of-missing-data-in-sas.html&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This is a simple approach.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 07 Oct 2022 20:10:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Correlation-Showing-Missing-Relationships/m-p/837458#M82122</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2022-10-07T20:10:07Z</dc:date>
    </item>
    <item>
      <title>Re: Correlation Showing Missing Relationships</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Correlation-Showing-Missing-Relationships/m-p/837472#M82124</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/435811"&gt;@brownster&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can also use PROC CORR to compute a correlation matrix from indicator variables defined as 1 if the original variable is missing, else 0, because the Pearson &lt;EM&gt;correlation&lt;/EM&gt; coefficient of such variables equals the phi coefficient (a measure of &lt;EM&gt;association&lt;/EM&gt; that you would normally compute with &lt;A href="https://documentation.sas.com/doc/en/statug/15.2/statug_freq_details08.htm" target="_blank" rel="noopener"&gt;PROC FREQ&lt;/A&gt;).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Example using SASHELP.HEART:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;/* Create table with information about missing levels of variables */

ods output nlevels=nlev;
proc freq data=sashelp.heart nlevels;
tables _all_ / noprint;
run;

/* Create indicator variables (1 if missing, else 0) for each variable with one or more missings */

proc sql noprint;
select cat('missing(',trim(tablevar),') as ',tablevar), tablevar
       into :indvars separated by ', ', :indvarlist separated by ' '
from nlev
where nmisslevels;

create table want as
select &amp;amp;indvars
from sashelp.heart;
quit;

/* Compute phi coefficients (=Pearson correl. coeff.) for all pairs of indicator variables */

proc corr data=want;
var &amp;amp;indvarlist;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 07 Oct 2022 22:04:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Correlation-Showing-Missing-Relationships/m-p/837472#M82124</guid>
      <dc:creator>FreelanceReinh</dc:creator>
      <dc:date>2022-10-07T22:04:21Z</dc:date>
    </item>
  </channel>
</rss>

