<?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 reg by group output with p value [how to improve your question] in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/Proc-reg-by-group-output-with-p-value/m-p/444225#M23316</link>
    <description>&lt;P&gt;Hello &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/152943"&gt;@kelSAS&lt;/a&gt;,&lt;/P&gt;&lt;BR /&gt; &lt;P&gt;Your question requires more details before experts can help.&amp;nbsp;Can you revise your question to include more information?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Review this checklist:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Specify a meaningful subject line for your topic.&amp;nbsp; Avoid generic subjects like "need help," "SAS query," or "urgent."&lt;/LI&gt;
&lt;LI&gt;When appropriate, provide sample data in text or DATA step format.&amp;nbsp; See &lt;A href="https://communities.sas.com/t5/SAS-Communities-Library/How-to-create-a-data-step-version-of-your-data-AKA-generate/ta-p/258712" target="_blank"&gt;this article for one method&lt;/A&gt;&amp;nbsp;you can use.&lt;/LI&gt;
&lt;LI&gt;If you're encountering an error in SAS, include the SAS log or a screenshot of the error condition.&amp;nbsp;Use the&amp;nbsp;&lt;STRONG&gt;Photos&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;button to include the image in your message.&lt;BR /&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" style="width: 279px;"&gt;&lt;IMG src="https://kntur85557.i.lithium.com/t5/image/serverpage/image-id/16608i91A52F817EAC9A69/image-dimensions/279x150?v=1.0" width="279" height="150" alt="use_buttons.png" title="use_buttons.png" /&gt;&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI&gt;It also helps to include an example (table or picture) of the result that you're trying to achieve.&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;To edit your original message, select the "blue gear" icon at the top of the message and select&amp;nbsp;&lt;STRONG&gt;Edit Message&lt;/STRONG&gt;.&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&lt;/STRONG&gt;From there you can adjust the title and add more details to the body of the message.&amp;nbsp; Or, simply reply to this message with any additional information you can supply.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" style="width: 229px;"&gt;&lt;IMG src="https://kntur85557.i.lithium.com/t5/image/serverpage/image-id/16605iAC020BC79315B045/image-size/large?v=1.0&amp;amp;px=600" alt="edit_post.png" title="edit_post.png" /&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;SAS experts are eager to help -- help&amp;nbsp;&lt;EM&gt;them&lt;/EM&gt; by providing as much detail as you can.&lt;/P&gt; &lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-style:italic;font-size:smaller;"&gt;This prewritten response was triggered for you by fellow SAS Support Communities member &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13884"&gt;@ballardw&lt;/a&gt;&lt;/SPAN&gt;&lt;/P&gt;.</description>
    <pubDate>Fri, 09 Mar 2018 19:25:12 GMT</pubDate>
    <dc:creator>Community_Guide</dc:creator>
    <dc:date>2018-03-09T19:25:12Z</dc:date>
    <item>
      <title>Proc reg by group output with p value</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Proc-reg-by-group-output-with-p-value/m-p/444214#M23315</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc reg data=aaa noprint outest=bbb;
by year;
model y=x1 x2;
proc print data=bbb; run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This gives me estimated coefficient per year, but I want to have another column with p-value next to the coefficient. Is there any way that I can do that? I used table out, but it adds rows, not columns that just complicates my reading through the output.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for your reply in advance.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 09 Mar 2018 22:28:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Proc-reg-by-group-output-with-p-value/m-p/444214#M23315</guid>
      <dc:creator>kelSAS</dc:creator>
      <dc:date>2018-03-09T22:28:27Z</dc:date>
    </item>
    <item>
      <title>Re: Proc reg by group output with p value [how to improve your question]</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Proc-reg-by-group-output-with-p-value/m-p/444225#M23316</link>
      <description>&lt;P&gt;Hello &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/152943"&gt;@kelSAS&lt;/a&gt;,&lt;/P&gt;&lt;BR /&gt; &lt;P&gt;Your question requires more details before experts can help.&amp;nbsp;Can you revise your question to include more information?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Review this checklist:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Specify a meaningful subject line for your topic.&amp;nbsp; Avoid generic subjects like "need help," "SAS query," or "urgent."&lt;/LI&gt;
&lt;LI&gt;When appropriate, provide sample data in text or DATA step format.&amp;nbsp; See &lt;A href="https://communities.sas.com/t5/SAS-Communities-Library/How-to-create-a-data-step-version-of-your-data-AKA-generate/ta-p/258712" target="_blank"&gt;this article for one method&lt;/A&gt;&amp;nbsp;you can use.&lt;/LI&gt;
&lt;LI&gt;If you're encountering an error in SAS, include the SAS log or a screenshot of the error condition.&amp;nbsp;Use the&amp;nbsp;&lt;STRONG&gt;Photos&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;button to include the image in your message.&lt;BR /&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" style="width: 279px;"&gt;&lt;IMG src="https://kntur85557.i.lithium.com/t5/image/serverpage/image-id/16608i91A52F817EAC9A69/image-dimensions/279x150?v=1.0" width="279" height="150" alt="use_buttons.png" title="use_buttons.png" /&gt;&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI&gt;It also helps to include an example (table or picture) of the result that you're trying to achieve.&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;To edit your original message, select the "blue gear" icon at the top of the message and select&amp;nbsp;&lt;STRONG&gt;Edit Message&lt;/STRONG&gt;.&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&lt;/STRONG&gt;From there you can adjust the title and add more details to the body of the message.&amp;nbsp; Or, simply reply to this message with any additional information you can supply.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" style="width: 229px;"&gt;&lt;IMG src="https://kntur85557.i.lithium.com/t5/image/serverpage/image-id/16605iAC020BC79315B045/image-size/large?v=1.0&amp;amp;px=600" alt="edit_post.png" title="edit_post.png" /&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;SAS experts are eager to help -- help&amp;nbsp;&lt;EM&gt;them&lt;/EM&gt; by providing as much detail as you can.&lt;/P&gt; &lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-style:italic;font-size:smaller;"&gt;This prewritten response was triggered for you by fellow SAS Support Communities member &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13884"&gt;@ballardw&lt;/a&gt;&lt;/SPAN&gt;&lt;/P&gt;.</description>
      <pubDate>Fri, 09 Mar 2018 19:25:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Proc-reg-by-group-output-with-p-value/m-p/444225#M23316</guid>
      <dc:creator>Community_Guide</dc:creator>
      <dc:date>2018-03-09T19:25:12Z</dc:date>
    </item>
    <item>
      <title>Re: Proc reg by group output with p value</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Proc-reg-by-group-output-with-p-value/m-p/444228#M23317</link>
      <description>&lt;P&gt;You can use proc transpose to change rows to columns from the TABLEOUT option.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Or use ods output to send the displayed parameter estimates table to a data set.&lt;/P&gt;
&lt;PRE&gt;proc reg data=sashelp.baseball;
   id name team league;
   model logSalary = nhits nruns nrbi nbb yrmajor crhits;
   ods output parameterestimates=work.parms;
run;
&lt;/PRE&gt;
&lt;P&gt;Send the variable, degrees of freedom, parameter esitmat, std err of the parameter, t value and the probT (p-vale) to the data set WORK.PARMS.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This is a very useful approach to know as some table of information are not at all accessible with any of the OUT= options and many of the newer procedures rely on this to get displayed table values into data sets. The online&amp;nbsp;documentation for procedures in the details section will usually have a section of "ODS Table Names" you can reference or use the ODS TRACE ON/OFF; before after a procedure to see the names of tables generated.&lt;/P&gt;</description>
      <pubDate>Fri, 09 Mar 2018 19:33:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Proc-reg-by-group-output-with-p-value/m-p/444228#M23317</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2018-03-09T19:33:15Z</dc:date>
    </item>
    <item>
      <title>Re: Proc reg by group output with p value</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Proc-reg-by-group-output-with-p-value/m-p/444291#M23318</link>
      <description>&lt;P&gt;Thank you so much. I used&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc reg data=aaa;
by year;
model y=x1 x2;
ods output parameterestimates=bbb;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;then, to only have coefficients and p-value, I used below transpose and merge.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc transpose data=bbb out=ccc prefix=x;
by fyear;
id variable;
var estimate;

proc transpose data=bbb out=ddd prefix=p;
by fyear;
id variable;
var probt;
run;

data ddd;
merge bbb(drop=_name_) ccc(drop=_name_);
by year;run;

proc print data=ddd;run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is so inefficient, but I got what I needed, so that's good, I guess.&lt;/P&gt;&lt;P&gt;Thank you so much for your help.&lt;/P&gt;</description>
      <pubDate>Fri, 09 Mar 2018 22:29:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Proc-reg-by-group-output-with-p-value/m-p/444291#M23318</guid>
      <dc:creator>kelSAS</dc:creator>
      <dc:date>2018-03-09T22:29:51Z</dc:date>
    </item>
    <item>
      <title>Re: Proc reg by group output with p value</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Proc-reg-by-group-output-with-p-value/m-p/444313#M23319</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/152943"&gt;@kelSAS&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;Thank you so much. I used&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc reg data=aaa;
by year;
model y=x1 x2;
ods output parameterestimates=bbb;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;then, to only have coefficients and p-value, I used below transpose and merge.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc transpose data=bbb out=ccc prefix=x;
by fyear;
id variable;
var estimate;

proc transpose data=bbb out=ddd prefix=p;
by fyear;
id variable;
var probt;
run;

data ddd;
merge bbb(drop=_name_) ccc(drop=_name_);
by year;run;

proc print data=ddd;run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This is so inefficient, but I got what I needed, so that's good, I guess.&lt;/P&gt;
&lt;P&gt;Thank you so much for your help.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;With no data I have no idea what you are building for your desired data set. I'm also confused by the use of YEAR in part of the code and FYEAR in others.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Proc report or proc tabulate likely can create a usable table with the BBB set directly but again without data I can't tell exactly. Something like:&lt;/P&gt;
&lt;PRE&gt;proc report data=bbb;
   column fyear variable,(estimate probt);
   define fyear /group;
   define variable /across;
   define estimate/analysis;
   define probt/analysis;
run;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You might be interested to know that you can use data set options with the ODS output to only keep the variables you want such as&lt;/P&gt;</description>
      <pubDate>Fri, 09 Mar 2018 23:56:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Proc-reg-by-group-output-with-p-value/m-p/444313#M23319</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2018-03-09T23:56:01Z</dc:date>
    </item>
  </channel>
</rss>

