<?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 - How to obtain actual values of conditional cumulative distribution functions in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/Proc-quantreg-How-to-obtain-actual-values-of-conditional/m-p/714210#M34522</link>
    <description>&lt;P&gt;&lt;EM&gt;&amp;gt;&amp;nbsp;Is there a way to make the print as "light weighted" as possible&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;I only used PROC PRINT to show you that the output data set contains a lot of information about the quantile process. You can omit the PROC PRINT. Or you can also print only the columns (or rows) that interest you.&lt;/P&gt;
&lt;P&gt;You can also suppress all output and just create the output data set, like this:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;ods exclude all;
proc  quantreg
      data  =     pro_fit
      ci          =           none;
      model
            y1    = x1 x2/quantlev=fqpr(n=30); /* 2 */
      conddist hr  testdata(so hr hf)=pro_predict 
            plot  =           ( cdfplot );
      ods output cdfplot=cdftest_pred; /* 3 */
run;
ods exclude none;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;EM&gt;&amp;gt;&amp;nbsp;where the prediction data set contains &amp;gt; 150 observations, I get "truncated"; i.e., I do not get values for observations n : n &amp;gt; 150.&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I don't understand this question. The first five columns of the output data set should have the same number of obs as the test data. Are you talking about the variables QuantPred1-QuantPred150?&amp;nbsp; I do not know how to change the number of output variables.&lt;/P&gt;</description>
    <pubDate>Tue, 26 Jan 2021 10:56:28 GMT</pubDate>
    <dc:creator>Rick_SAS</dc:creator>
    <dc:date>2021-01-26T10:56:28Z</dc:date>
    <item>
      <title>Proc quantreg - How to obtain actual values of conditional cumulative distribution functions</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Proc-quantreg-How-to-obtain-actual-values-of-conditional/m-p/713856#M34517</link>
      <description>&lt;P&gt;Dear community,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would please like to ask for your help concerning the following issue.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;As "&lt;FONT face="courier new,courier"&gt;proc quanrteg&lt;/FONT&gt;" offers the opportunity to estimate conditional cumulative distribution functions (:= CDFs),&lt;/P&gt;&lt;P&gt;instead of plotting a graph, I would please like to know, how to obtain the predictions for arbitrary values on the plot's abscissa, i.e., nothing else but predicted values for the CDF(x),&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Example:&lt;/P&gt;&lt;P&gt;1. First, I would like to use "&lt;FONT face="courier new,courier"&gt;proc quantreg&lt;/FONT&gt;" to fit the model. Say, on a sample of N_1 = 1000 observations, with dependent variable y and independent variables x1 and x2.&lt;/P&gt;&lt;P&gt;2. Second, I would like to use the fitted model from step one, to get estimated for a new sample of N_2 = 100 new observations, for which I observe x_1 and x_2;&lt;/P&gt;&lt;P&gt;assume, I am interested, for each observation, in the estimated value for CDF(7) (i.e., the probability, that y is smaller-or-equal to -1) , CDF(11), and CDF(13).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The beginnings for the example follow.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would be very glad if you were to provide help for this question of mine, please.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Yours sincerely,&lt;/P&gt;&lt;P&gt;Sinistrum&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data	pro_fit;
	seed 	=	1;
	call	streaminit(seed);
	do		i	=	1	to		1000;
		x1	= 	rand ('normal',	10,	2);
		x2	=	rand ('normal',	5,	1);
		y1	=	1	+	2 * x1 + 5 * x2 + rand ('normal',	0,	0.5);
	output;
	end;
	drop seed;
run;
data	pro_predict;
	seed 	=	2;
	call	streaminit(seed);
	do		i	=	1	to		100;
		x1	= 	rand ('normal',	10,	2);
		x2	=	rand ('normal',	5,	1);
	output;
	end;
	drop seed;
run;
proc	quantreg
	data	=	pro_fit
	ci		=		none;
	model
		y1 	= x1 x2;
	conddist  
		plot	=		(
							cdfplot
							pdfplot
						)
					;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 25 Jan 2021 09:21:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Proc-quantreg-How-to-obtain-actual-values-of-conditional/m-p/713856#M34517</guid>
      <dc:creator>Sinistrum</dc:creator>
      <dc:date>2021-01-25T09:21:42Z</dc:date>
    </item>
    <item>
      <title>Re: Proc quantreg - How to obtain actual values of conditional cumulative distribution functions</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Proc-quantreg-How-to-obtain-actual-values-of-conditional/m-p/714099#M34518</link>
      <description>&lt;P&gt;I discussed this with a colleague, who suggested that you&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;look at the TESTDATA= option on the CONDIST statement. To use it, you must have a valid response (y1) value in the "pro_predict" data set.&lt;/LI&gt;
&lt;LI&gt;Use the fast quantile process (FQPR) option on the QUANTLEV= option on the MODEL statement&amp;nbsp;&lt;/LI&gt;
&lt;LI&gt;&lt;A href="https://blogs.sas.com/content/iml/2012/08/01/data-fro-ods-graphics.html" target="_self"&gt;Use ODS OUTPUT to capture the data&lt;/A&gt; that is contained in the conditional CDF plot.&lt;/LI&gt;
&lt;/OL&gt;
&lt;P&gt;Try the following:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data  pro_fit;
      seed =     1;
      call  streaminit(seed);
      do          i     =     1     to          1000;
            x1    =     rand ('normal',   10,   2);
            x2    =     rand ('normal',   5,    1);
            y1    =     1     +     2 * x1 + 5 * x2 + rand ('normal',   0,    0.5);
      output;
      end;
      drop seed;
run;
data  pro_predict;
      seed =     2;
      call  streaminit(seed);
      do          i     =     1     to          100;
            x1    =     rand ('normal',   10,   2);
            x2    =     rand ('normal',   5,    1);
            y1= 50;   /* 1. Need a valid response for testdata. */
      output;
      end;
      drop seed;
run;
ods graphics on;

ods output cdfplot=cdftest_pred; /* 3 */
proc  quantreg
      data  =     pro_fit
      ci          =           none;
      model
            y1    = x1 x2/quantlev=fqpr(n=30); /* 2 */
      conddist hr  testdata(so hr hf)=pro_predict 
            plot  =           ( cdfplot );
run;

proc print data= cdftest_pred;
run;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 25 Jan 2021 22:10:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Proc-quantreg-How-to-obtain-actual-values-of-conditional/m-p/714099#M34518</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2021-01-25T22:10:33Z</dc:date>
    </item>
    <item>
      <title>Re: Proc quantreg - How to obtain actual values of conditional cumulative distribution functions</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Proc-quantreg-How-to-obtain-actual-values-of-conditional/m-p/714186#M34520</link>
      <description>&lt;P&gt;Thank you very much indeed. Once more, this is so enormous - breathtaking, the help I received thus far from this board.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;With this work-around, I definitely am ought to be able to extract the information I am after (plus: I learned a new technique, how to access values used for plotting).&lt;/P&gt;&lt;P&gt;However, due to the necessity to not &lt;A href="https://blogs.sas.com/content/iml/2015/05/26/suppress-ods.html" target="_self"&gt;suppress ODS-output&lt;/A&gt;, I fear performance issues. Is there a way to make the print as "light weighted" as possible (I am sorry; it feels like I got given an inch, and I ask for an ell)?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Either way, my question is resolved; thank you once again.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;---&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Edit:&lt;/P&gt;&lt;P&gt;I am sorry, though in the use case, where the prediction data set contains &amp;gt; 150 observations, I get "truncated"; i.e., I do not get values for observations n : n &amp;gt; 150.&lt;/P&gt;&lt;P&gt;Could you please tell me, whether there is a straightforward way to resolve this issue (instead of looping)?&lt;/P&gt;</description>
      <pubDate>Tue, 26 Jan 2021 10:28:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Proc-quantreg-How-to-obtain-actual-values-of-conditional/m-p/714186#M34520</guid>
      <dc:creator>Sinistrum</dc:creator>
      <dc:date>2021-01-26T10:28:46Z</dc:date>
    </item>
    <item>
      <title>Re: Proc quantreg - How to obtain actual values of conditional cumulative distribution functions</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Proc-quantreg-How-to-obtain-actual-values-of-conditional/m-p/714210#M34522</link>
      <description>&lt;P&gt;&lt;EM&gt;&amp;gt;&amp;nbsp;Is there a way to make the print as "light weighted" as possible&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;I only used PROC PRINT to show you that the output data set contains a lot of information about the quantile process. You can omit the PROC PRINT. Or you can also print only the columns (or rows) that interest you.&lt;/P&gt;
&lt;P&gt;You can also suppress all output and just create the output data set, like this:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;ods exclude all;
proc  quantreg
      data  =     pro_fit
      ci          =           none;
      model
            y1    = x1 x2/quantlev=fqpr(n=30); /* 2 */
      conddist hr  testdata(so hr hf)=pro_predict 
            plot  =           ( cdfplot );
      ods output cdfplot=cdftest_pred; /* 3 */
run;
ods exclude none;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;EM&gt;&amp;gt;&amp;nbsp;where the prediction data set contains &amp;gt; 150 observations, I get "truncated"; i.e., I do not get values for observations n : n &amp;gt; 150.&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I don't understand this question. The first five columns of the output data set should have the same number of obs as the test data. Are you talking about the variables QuantPred1-QuantPred150?&amp;nbsp; I do not know how to change the number of output variables.&lt;/P&gt;</description>
      <pubDate>Tue, 26 Jan 2021 10:56:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Proc-quantreg-How-to-obtain-actual-values-of-conditional/m-p/714210#M34522</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2021-01-26T10:56:28Z</dc:date>
    </item>
    <item>
      <title>Re: Proc quantreg - How to obtain actual values of conditional cumulative distribution functions</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Proc-quantreg-How-to-obtain-actual-values-of-conditional/m-p/714214#M34523</link>
      <description>&lt;P&gt;&lt;EM&gt;&amp;gt;&amp;nbsp;Is there a way to make the print as "light weighted" as possible&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;Exactly what I was looking for - thank you so much&lt;/P&gt;&lt;P&gt;(Thank you; I was aware that the last print was merely due to showcase the result data set; I did want to suppress the cdf-plot statements, which you have shown me is possible via &lt;FONT face="courier new,courier"&gt;ods exclude&lt;/FONT&gt;;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;gt;&amp;nbsp;where the prediction data set contains &amp;gt; 150 observations, I get "truncated"; i.e., I do not get values for observations n : n &amp;gt; 150.&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;Sorry for being confusing; but, yes, indeed, you understood it correctly - I am "talking about the variables QuantPred1-QuantPred150"; SAS simply stops there (n=150) and does not provide the QuantPred-Values for the last n, such that n &amp;gt; 150, observations.&lt;/P&gt;&lt;P&gt;I shall start a new topic on this one. To wrap a loop around this one seems to be pretty clumsy.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you once again.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 26 Jan 2021 11:06:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Proc-quantreg-How-to-obtain-actual-values-of-conditional/m-p/714214#M34523</guid>
      <dc:creator>Sinistrum</dc:creator>
      <dc:date>2021-01-26T11:06:27Z</dc:date>
    </item>
  </channel>
</rss>

