<?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 QUANTREG BY STATEMENT with ODS OUTPUT in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/PROC-QUANTREG-BY-STATEMENT-with-ODS-OUTPUT/m-p/719380#M34802</link>
    <description>My generated dataset of estimates only had output from one model. Though this was because I put the BY statement in the wrong model.  It was a simple error on my part. I was trying to run a bunch of datasets through the PROC QUANTREG similarly to a bootstrap approach.</description>
    <pubDate>Mon, 15 Feb 2021 16:58:03 GMT</pubDate>
    <dc:creator>H</dc:creator>
    <dc:date>2021-02-15T16:58:03Z</dc:date>
    <item>
      <title>PROC QUANTREG BY STATEMENT with ODS OUTPUT</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/PROC-QUANTREG-BY-STATEMENT-with-ODS-OUTPUT/m-p/719372#M34799</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;I am using the BY statement in PROC QUANTREG along with ODS OUTPUT in order to generate a dataset with all of the listed quantile estimates for all of the models. The below code does this for just one of the models, instead of all ten which is desired. Further below is the code for a reproducible example.&amp;nbsp; Any suggestions would be appreciated.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc quantreg ci=sparsity/iid algorithm=interior(tolerance=1.e-4) 
                 data=table alpha=0.01;
      model diff_6 =  /
                     quantile= 0.05 to 0.95 by 0.15
                     plot=quantplot;
	ods output   ParameterEstimates  = Estimates;
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;Reproducible full code, there are some elements still included in the data creation step that aren't relevant to the inquiry, but these variables should be apparent.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let N = 20;
%let Numsamples = 10;
data Table1 (keep=Baseline Xc_3 sampleID);
	call streaminit(4321);

	p0 = 1.00;
	p1 = 0.60; p2 = 0.20; p3 = 0.10; p4 = 0.05; p5 = 0.03; p6 = 01; p7 = 0.01; p8 = 0.0; 
	do sampleID = 1 to &amp;amp;numsamples;
		do i = 1 to &amp;amp;N;
			Baseline = rand("Table1", p0);
			Xc_3 = rand("Table1", p1, p2, p3, p4, p5, p6, p7, p8);
			output;
		end;
	end;
run;
data Table2 (keep=Xc_6);
	call streaminit(432109);

	p1 = 0.60; p2 = 0.20; p3 = 0.10; p4 = 0.05; p5 = 0.03; p6 = 01; p7 = 0.01; p8 = 0.0; 

	do sampleID = 1 to &amp;amp;numsamples;
		do i = 1 to &amp;amp;N;
			Xc_6 = rand("Table1", p1, p2, p3, p4, p5, p6, p7, p8);
			output;
		end;
	end;
run;

data Table3 (keep=Xnc_3);
	call streaminit(43927);

	p1 = 0.80; p2 = 0.13; p3 = 0.05;  p4=0.02; 

	do sampleID = 1 to &amp;amp;numsamples;
		do i = 1 to &amp;amp;N;
			Xnc_3 = rand("Table3", p1, p2, p3, p4);
			output;
		end;
	end;
run;

data Table4 (keep=Xnc_6);
	call streaminit(43215);

	p1 = 0.80; p2 = 0.13; p3 = 0.05;  p4=0.02; 

	do sampleID = 1 to &amp;amp;numsamples;
		do i = 1 to &amp;amp;N;
			Xnc_6 = rand("Table3", p1, p2, p3, p4);
			output;
		end;
	end;
run;

data Table;
	merge Table1-Table4;
run;


data Table;
	set Table;
	Baseline = Baseline + 19;
	Xc_3 = Xc_3-1;
	Xc_6 = Xc_6-1;
	Xc_6t = Xc_3 + Xc_6;

	Xnc_3  = Xnc_3-1;
	Xnc_6  = Xnc_6-1;
	Xnc_6t = Xnc_3 + Xnc_6;

	diff_3 = Xc_3 - Xnc_3;
	diff_6 = Xc_6t - Xnc_6t;
run;

proc freq data=table;
	tables 	(Baseline 
			Xc_3 
			Xc_6 
			Xc_6t

			Xnc_3 
			Xnc_6 
			Xnc_6t

			diff_3
			diff_6) * sampleID / nocum;
run;
ods graphics on;

proc quantreg ci=sparsity/iid algorithm=interior(tolerance=1.e-4) 
                 data=table alpha=0.01;
	by sampleID;
      model diff_3 =  /
                     quantile= 0.05 to 0.95 by 0.15
                     plot=quantplot;
run;
ods graphics off;
ods trace on;
ods graphics on;
proc quantreg ci=sparsity/iid algorithm=interior(tolerance=1.e-4) 
                 data=table alpha=0.01;
      model diff_6 =  /
                     quantile= 0.05 to 0.95 by 0.15
                     plot=quantplot;
	ods output   ParameterEstimates  = Estimates;
run;
ods graphics off;
ods trace off;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 15 Feb 2021 16:21:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/PROC-QUANTREG-BY-STATEMENT-with-ODS-OUTPUT/m-p/719372#M34799</guid>
      <dc:creator>H</dc:creator>
      <dc:date>2021-02-15T16:21:17Z</dc:date>
    </item>
    <item>
      <title>Re: PROC QUANTREG BY STATEMENT with ODS OUTPUT</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/PROC-QUANTREG-BY-STATEMENT-with-ODS-OUTPUT/m-p/719378#M34800</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/2723"&gt;@H&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;I am using the BY statement in PROC QUANTREG along with ODS OUTPUT in order to generate a dataset with all of the listed quantile estimates for all of the models. The below code does this for just one of the models, instead of all ten which is desired. Further below is the code for a reproducible example.&amp;nbsp; Any suggestions would be appreciated.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;What is your question?&lt;/P&gt;</description>
      <pubDate>Mon, 15 Feb 2021 16:55:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/PROC-QUANTREG-BY-STATEMENT-with-ODS-OUTPUT/m-p/719378#M34800</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2021-02-15T16:55:39Z</dc:date>
    </item>
    <item>
      <title>Re: PROC QUANTREG BY STATEMENT with ODS OUTPUT</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/PROC-QUANTREG-BY-STATEMENT-with-ODS-OUTPUT/m-p/719379#M34801</link>
      <description>Well, it may help if I put the BY statement and the ODS OUTPUT statements in the same procedure &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;BR /&gt;&lt;BR /&gt;I have resolved the issue!</description>
      <pubDate>Mon, 15 Feb 2021 16:55:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/PROC-QUANTREG-BY-STATEMENT-with-ODS-OUTPUT/m-p/719379#M34801</guid>
      <dc:creator>H</dc:creator>
      <dc:date>2021-02-15T16:55:39Z</dc:date>
    </item>
    <item>
      <title>Re: PROC QUANTREG BY STATEMENT with ODS OUTPUT</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/PROC-QUANTREG-BY-STATEMENT-with-ODS-OUTPUT/m-p/719380#M34802</link>
      <description>My generated dataset of estimates only had output from one model. Though this was because I put the BY statement in the wrong model.  It was a simple error on my part. I was trying to run a bunch of datasets through the PROC QUANTREG similarly to a bootstrap approach.</description>
      <pubDate>Mon, 15 Feb 2021 16:58:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/PROC-QUANTREG-BY-STATEMENT-with-ODS-OUTPUT/m-p/719380#M34802</guid>
      <dc:creator>H</dc:creator>
      <dc:date>2021-02-15T16:58:03Z</dc:date>
    </item>
  </channel>
</rss>

