<?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 Re: PROC CORR: &amp;quot;partial&amp;quot; statement in missing data in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/PROC-CORR-quot-partial-quot-statement-in-missing-data/m-p/224483#M11859</link>
    <description>&lt;P&gt;Here's the main idea: Run 50 single-variable regressions to generate the residuals when each biomarker is regressed on VarE.&lt;/P&gt;&lt;P&gt;Then compute the correlation of the residuals.&amp;nbsp; Here's some code for the case of three variables, using Weight as the&amp;nbsp;PARTIAL variable:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;/* run 50 linear regressions and save residuals */
ods graphics off;
proc reg data=Sashelp.Heart noprint;
model AgeAtStart = weight;
output out=Out1(keep=R rename=(R=AgeAtStart)) r=R;
quit;
/* ...etc...run 47 other analyses */
proc reg data=Sashelp.Heart noprint;
model Smoking = weight;
output out=Out2(keep=R rename=(R=Smoking)) r=R;
quit;
proc reg data=Sashelp.Heart noprint;
model Cholesterol = weight;
output out=Out3(keep=R rename=(R=Cholesterol)) r=R;
quit;

/* accumulate residuals */
data Residuals;
merge Out1-Out3;
run;

/* compute the pairwise correlations of the residuals */
proc corr data=Residuals nosimple noprob; /* pairwise missing */
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The hard part is to do those 50 one-variable regressions.&amp;nbsp; Fifty is not too many, so you can (1) cut-and-paste by hand, or (2) write a SAS macro.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;There is a third option, (3) convert the data from wide to long and replicate the VarE variable and use a BY group approach to compute all 50 regressions with a single call to PROC REG.&amp;nbsp; For an example of converting wide to long and replicating the VarE variable, see the article &lt;A href="http://blogs.sas.com/content/iml/2015/02/25/plotting-multiple-series-transforming-data-from-wide-to-long.html" target="_self"&gt;"Plotting multiple time series."&lt;/A&gt;&amp;nbsp; Then you'd need to transpose back to wide form to use PROC CORR.&lt;/P&gt;</description>
    <pubDate>Tue, 08 Sep 2015 19:25:53 GMT</pubDate>
    <dc:creator>Rick_SAS</dc:creator>
    <dc:date>2015-09-08T19:25:53Z</dc:date>
    <item>
      <title>PROC CORR: "partial" statement in missing data</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/PROC-CORR-quot-partial-quot-statement-in-missing-data/m-p/224460#M11857</link>
      <description>&lt;P&gt;I loose a lot of cases with missing value in this analysis!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to analyze correlation among my biomarkers, varA varB varC varD, controlling for varE.&amp;nbsp; My code is;&lt;/P&gt;&lt;P&gt;proc corr;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; var varA varB varC varD;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; partial varE;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have N=1500 in my data set, in which cases have at least one biomarker.&amp;nbsp; However, varA has 300 missing cases, varB has 500 missing cases, varC has 150 missing cases, and varE has 500 missing cases.&amp;nbsp; Some missing cases are overlapped but the others are not overlapped.&amp;nbsp; When I use the above code, there are only N=50.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How can I calculate, for example, a correlation between varA and varB controlling for varE using &lt;U&gt;all available cases&lt;/U&gt; with varA, varB and varE data?&lt;/P&gt;&lt;P&gt;I actually have 50 biomarker variables in the correlation analysis.&amp;nbsp; It is too much to type all pair-wise analyses (1225 pairs) by hand!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you in advance for your help!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Sincerely,&lt;/P&gt;&lt;P&gt;Rcore&lt;/P&gt;</description>
      <pubDate>Tue, 08 Sep 2015 17:50:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/PROC-CORR-quot-partial-quot-statement-in-missing-data/m-p/224460#M11857</guid>
      <dc:creator>Rcore</dc:creator>
      <dc:date>2015-09-08T17:50:04Z</dc:date>
    </item>
    <item>
      <title>Re: PROC CORR: "partial" statement in missing data</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/PROC-CORR-quot-partial-quot-statement-in-missing-data/m-p/224483#M11859</link>
      <description>&lt;P&gt;Here's the main idea: Run 50 single-variable regressions to generate the residuals when each biomarker is regressed on VarE.&lt;/P&gt;&lt;P&gt;Then compute the correlation of the residuals.&amp;nbsp; Here's some code for the case of three variables, using Weight as the&amp;nbsp;PARTIAL variable:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;/* run 50 linear regressions and save residuals */
ods graphics off;
proc reg data=Sashelp.Heart noprint;
model AgeAtStart = weight;
output out=Out1(keep=R rename=(R=AgeAtStart)) r=R;
quit;
/* ...etc...run 47 other analyses */
proc reg data=Sashelp.Heart noprint;
model Smoking = weight;
output out=Out2(keep=R rename=(R=Smoking)) r=R;
quit;
proc reg data=Sashelp.Heart noprint;
model Cholesterol = weight;
output out=Out3(keep=R rename=(R=Cholesterol)) r=R;
quit;

/* accumulate residuals */
data Residuals;
merge Out1-Out3;
run;

/* compute the pairwise correlations of the residuals */
proc corr data=Residuals nosimple noprob; /* pairwise missing */
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The hard part is to do those 50 one-variable regressions.&amp;nbsp; Fifty is not too many, so you can (1) cut-and-paste by hand, or (2) write a SAS macro.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;There is a third option, (3) convert the data from wide to long and replicate the VarE variable and use a BY group approach to compute all 50 regressions with a single call to PROC REG.&amp;nbsp; For an example of converting wide to long and replicating the VarE variable, see the article &lt;A href="http://blogs.sas.com/content/iml/2015/02/25/plotting-multiple-series-transforming-data-from-wide-to-long.html" target="_self"&gt;"Plotting multiple time series."&lt;/A&gt;&amp;nbsp; Then you'd need to transpose back to wide form to use PROC CORR.&lt;/P&gt;</description>
      <pubDate>Tue, 08 Sep 2015 19:25:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/PROC-CORR-quot-partial-quot-statement-in-missing-data/m-p/224483#M11859</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2015-09-08T19:25:53Z</dc:date>
    </item>
    <item>
      <title>Re: PROC CORR: "partial" statement in missing data</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/PROC-CORR-quot-partial-quot-statement-in-missing-data/m-p/228132#M12055</link>
      <description>&lt;P&gt;This is really helpful and worked.&amp;nbsp; Thank you very much!!&lt;/P&gt;</description>
      <pubDate>Thu, 01 Oct 2015 20:27:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/PROC-CORR-quot-partial-quot-statement-in-missing-data/m-p/228132#M12055</guid>
      <dc:creator>Rcore</dc:creator>
      <dc:date>2015-10-01T20:27:48Z</dc:date>
    </item>
  </channel>
</rss>

