<?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 Joining and reshaping tables in PROC GLM in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Joining-and-reshaping-tables-in-PROC-GLM/m-p/664680#M198612</link>
    <description>&lt;P&gt;How can I get an output from PROC GLM to be like below:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;VarName&amp;nbsp; &amp;nbsp;RSQUARE&amp;nbsp; &amp;nbsp;height_MEAN&amp;nbsp; &amp;nbsp;Coeff Var&lt;BR /&gt;&amp;nbsp; &amp;nbsp; weight&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;xx&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; xxx&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;ww&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; sex&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; yy&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; yyy&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;www&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It is easy in proc reg but I don't know how to do it in proc glm.&lt;/P&gt;&lt;P&gt;Thank you for your response.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 24 Jun 2020 15:53:15 GMT</pubDate>
    <dc:creator>mh2t</dc:creator>
    <dc:date>2020-06-24T15:53:15Z</dc:date>
    <item>
      <title>Joining and reshaping tables in PROC GLM</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Joining-and-reshaping-tables-in-PROC-GLM/m-p/664680#M198612</link>
      <description>&lt;P&gt;How can I get an output from PROC GLM to be like below:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;VarName&amp;nbsp; &amp;nbsp;RSQUARE&amp;nbsp; &amp;nbsp;height_MEAN&amp;nbsp; &amp;nbsp;Coeff Var&lt;BR /&gt;&amp;nbsp; &amp;nbsp; weight&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;xx&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; xxx&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;ww&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; sex&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; yy&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; yyy&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;www&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It is easy in proc reg but I don't know how to do it in proc glm.&lt;/P&gt;&lt;P&gt;Thank you for your response.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 24 Jun 2020 15:53:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Joining-and-reshaping-tables-in-PROC-GLM/m-p/664680#M198612</guid>
      <dc:creator>mh2t</dc:creator>
      <dc:date>2020-06-24T15:53:15Z</dc:date>
    </item>
    <item>
      <title>Re: Joining and reshaping tables in PROC GLM</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Joining-and-reshaping-tables-in-PROC-GLM/m-p/664684#M198615</link>
      <description>You have an RSquare for each variable? How does that work?</description>
      <pubDate>Wed, 24 Jun 2020 16:06:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Joining-and-reshaping-tables-in-PROC-GLM/m-p/664684#M198615</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2020-06-24T16:06:47Z</dc:date>
    </item>
    <item>
      <title>Re: Joining and reshaping tables in PROC GLM</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Joining-and-reshaping-tables-in-PROC-GLM/m-p/664687#M198616</link>
      <description>so we run two univariate glm models, each has a separate RSquare in the output.</description>
      <pubDate>Wed, 24 Jun 2020 16:12:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Joining-and-reshaping-tables-in-PROC-GLM/m-p/664687#M198616</guid>
      <dc:creator>mh2t</dc:creator>
      <dc:date>2020-06-24T16:12:12Z</dc:date>
    </item>
    <item>
      <title>Re: Joining and reshaping tables in PROC GLM</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Joining-and-reshaping-tables-in-PROC-GLM/m-p/664688#M198617</link>
      <description>Do you have code to already run all those regressions? If we can add our solution to yours that's more efficient.</description>
      <pubDate>Wed, 24 Jun 2020 16:15:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Joining-and-reshaping-tables-in-PROC-GLM/m-p/664688#M198617</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2020-06-24T16:15:48Z</dc:date>
    </item>
    <item>
      <title>Re: Joining and reshaping tables in PROC GLM</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Joining-and-reshaping-tables-in-PROC-GLM/m-p/664697#M198619</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;/* 1. transpose from wide (Y, X1 ,...,X100) to long (varNum VarName Y Value) */
data Long;
set Wide;                       /* &amp;lt;== specify data set name HERE         */
array x [*] x1-x&amp;amp;nCont;         /* &amp;lt;== specify explanatory variables HERE */
do varNum = 1 to dim(x);
   VarName = vname(x[varNum]);  /* variable name in char var */
   Value = x[varNum];           /* value for each variable for each obs */
   output;
end;
drop x:;
run;

/* 2. Sort by BY-group variable */
proc sort data=Long;  by VarName;  run;


/* 3. univariate glm regression on single predictor*/
proc glm data=Long outstat=PE;
   CLASS Value;
   by VarName;
   model Y = Value;
   ods select FitStatistics;
quit;

proc print data=PE;
run;quit;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 24 Jun 2020 16:23:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Joining-and-reshaping-tables-in-PROC-GLM/m-p/664697#M198619</guid>
      <dc:creator>mh2t</dc:creator>
      <dc:date>2020-06-24T16:23:30Z</dc:date>
    </item>
    <item>
      <title>Re: Joining and reshaping tables in PROC GLM</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Joining-and-reshaping-tables-in-PROC-GLM/m-p/664706#M198624</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;/* 3. univariate glm regression on single predictor*/
proc glm data=Long outstat=PE;
   CLASS Value;
   by VarName;
   model Y = Value;
   *ods select FitStatistics;
ods output fitstatistics = rSquared parameterEstimates = PE(where=(Parameter='Value'));
quit;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;This will capture the data for you in a clean fashion into two data sets rSQuared and PE. You can then merge them to get the table you want. I think for means you'll need a PROC MEANS for mean.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 24 Jun 2020 16:45:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Joining-and-reshaping-tables-in-PROC-GLM/m-p/664706#M198624</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2020-06-24T16:45:20Z</dc:date>
    </item>
    <item>
      <title>Re: Joining and reshaping tables in PROC GLM</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Joining-and-reshaping-tables-in-PROC-GLM/m-p/664721#M198630</link>
      <description>Thank you &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13879"&gt;@Reeza&lt;/a&gt;. I'm very new to SAS environment, I don't know how to merge them.</description>
      <pubDate>Wed, 24 Jun 2020 17:32:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Joining-and-reshaping-tables-in-PROC-GLM/m-p/664721#M198630</guid>
      <dc:creator>mh2t</dc:creator>
      <dc:date>2020-06-24T17:32:36Z</dc:date>
    </item>
    <item>
      <title>Re: Joining and reshaping tables in PROC GLM</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Joining-and-reshaping-tables-in-PROC-GLM/m-p/664728#M198632</link>
      <description>Here's a great tutorial on merging. &lt;BR /&gt;&lt;A href="https://stats.idre.ucla.edu/sas/modules/match-merging-data-files-in-sas/" target="_blank"&gt;https://stats.idre.ucla.edu/sas/modules/match-merging-data-files-in-sas/&lt;/A&gt;</description>
      <pubDate>Wed, 24 Jun 2020 17:52:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Joining-and-reshaping-tables-in-PROC-GLM/m-p/664728#M198632</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2020-06-24T17:52:57Z</dc:date>
    </item>
  </channel>
</rss>

