<?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 Need help with probit function. in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/Need-help-with-probit-function/m-p/771521#M30969</link>
    <description>&lt;P&gt;Hi every one,&lt;/P&gt;&lt;P&gt;I am writing&amp;nbsp; a function using probit function to convert probabilities to a z_normal values like this:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="phongpham_0-1633046986095.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/64286i4FAA8A311D5DFF69/image-size/medium?v=v2&amp;amp;px=400" role="button" title="phongpham_0-1633046986095.png" alt="phongpham_0-1633046986095.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;When I use probabilities that smaller than 1 and greater than 0, Probit works well.&amp;nbsp;&lt;/P&gt;&lt;P&gt;( for this I use this piece of code: z_inv = probit(Cum_TM[2:6,1:6]); )&lt;/P&gt;&lt;P&gt;but when I use&amp;nbsp;probabilities that equal 1 or 0, Probit does not work&amp;nbsp; any more.&lt;/P&gt;&lt;P&gt;( for this I use this piece of code:&amp;nbsp; z_inv = probit(Cum_TM[1:8,1:7]); ) and I got this error:&lt;/P&gt;&lt;P&gt;ERROR: (execution) Invalid argument to function.&lt;/P&gt;&lt;P&gt;count : number of occurrences is 23&lt;BR /&gt;operation : PROBIT at line 42 column 17&lt;BR /&gt;operands : _TEM1003&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="phongpham_1-1633047258311.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/64287i3AA7C51E0368303D/image-size/medium?v=v2&amp;amp;px=400" role="button" title="phongpham_1-1633047258311.png" alt="phongpham_1-1633047258311.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I just wonder if you please help me to solve this error.&lt;/P&gt;&lt;P&gt;Thank you very much for your help!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is my complete code and data for your reference:&lt;/P&gt;&lt;P&gt;proc import datafile = '/proj/sas/sasdata/risk/discovery/grm/ifrs/au/sme/phase2/OLL/OLL_transition_matrix_1.xlsx'&lt;BR /&gt;replace dbms = xlsx out = Calibrated_matrix_OLL;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;%let tm_in = Calibrated_matrix_OLL;;&lt;BR /&gt;%let z_in = z_25;&lt;BR /&gt;%let w =0.06;&lt;BR /&gt;%let TM_out = matrix_ca_da_oll_out;&lt;/P&gt;&lt;P&gt;proc iml;&lt;BR /&gt;use &amp;amp;TM_in.;&lt;BR /&gt;read all var _ALL_ into TM_Input;&lt;BR /&gt;close &amp;amp;TM_in.;&lt;BR /&gt;TM = TM_Input[,3:10]; *print TM;&lt;BR /&gt;Start rowcumsum(x);&lt;BR /&gt;Step1 = cusum(x);&lt;BR /&gt;Step2 = 0 // Step1[1:nrow(Step1)-1,ncol(Step1)];&lt;BR /&gt;Output = Step1 - repeat(Step2,1,ncol(Step1));&lt;BR /&gt;return(Output);&lt;BR /&gt;Finish rowcumsum;&lt;BR /&gt;do i = 1 to 1; *number of quarters;&lt;BR /&gt;Pre_cycle_adj = TM[(1+8*(i-1)):(8*i),1:8]; print Pre_cycle_adj;&lt;BR /&gt;Cum_TM = rowcumsum(Pre_cycle_adj); print Cum_TM;&lt;BR /&gt;z_inv = probit(Cum_TM[1:8,1:7]); print z_inv;&lt;BR /&gt;end;&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;</description>
    <pubDate>Fri, 01 Oct 2021 00:17:03 GMT</pubDate>
    <dc:creator>phongpham</dc:creator>
    <dc:date>2021-10-01T00:17:03Z</dc:date>
    <item>
      <title>Need help with probit function.</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Need-help-with-probit-function/m-p/771521#M30969</link>
      <description>&lt;P&gt;Hi every one,&lt;/P&gt;&lt;P&gt;I am writing&amp;nbsp; a function using probit function to convert probabilities to a z_normal values like this:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="phongpham_0-1633046986095.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/64286i4FAA8A311D5DFF69/image-size/medium?v=v2&amp;amp;px=400" role="button" title="phongpham_0-1633046986095.png" alt="phongpham_0-1633046986095.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;When I use probabilities that smaller than 1 and greater than 0, Probit works well.&amp;nbsp;&lt;/P&gt;&lt;P&gt;( for this I use this piece of code: z_inv = probit(Cum_TM[2:6,1:6]); )&lt;/P&gt;&lt;P&gt;but when I use&amp;nbsp;probabilities that equal 1 or 0, Probit does not work&amp;nbsp; any more.&lt;/P&gt;&lt;P&gt;( for this I use this piece of code:&amp;nbsp; z_inv = probit(Cum_TM[1:8,1:7]); ) and I got this error:&lt;/P&gt;&lt;P&gt;ERROR: (execution) Invalid argument to function.&lt;/P&gt;&lt;P&gt;count : number of occurrences is 23&lt;BR /&gt;operation : PROBIT at line 42 column 17&lt;BR /&gt;operands : _TEM1003&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="phongpham_1-1633047258311.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/64287i3AA7C51E0368303D/image-size/medium?v=v2&amp;amp;px=400" role="button" title="phongpham_1-1633047258311.png" alt="phongpham_1-1633047258311.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I just wonder if you please help me to solve this error.&lt;/P&gt;&lt;P&gt;Thank you very much for your help!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is my complete code and data for your reference:&lt;/P&gt;&lt;P&gt;proc import datafile = '/proj/sas/sasdata/risk/discovery/grm/ifrs/au/sme/phase2/OLL/OLL_transition_matrix_1.xlsx'&lt;BR /&gt;replace dbms = xlsx out = Calibrated_matrix_OLL;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;%let tm_in = Calibrated_matrix_OLL;;&lt;BR /&gt;%let z_in = z_25;&lt;BR /&gt;%let w =0.06;&lt;BR /&gt;%let TM_out = matrix_ca_da_oll_out;&lt;/P&gt;&lt;P&gt;proc iml;&lt;BR /&gt;use &amp;amp;TM_in.;&lt;BR /&gt;read all var _ALL_ into TM_Input;&lt;BR /&gt;close &amp;amp;TM_in.;&lt;BR /&gt;TM = TM_Input[,3:10]; *print TM;&lt;BR /&gt;Start rowcumsum(x);&lt;BR /&gt;Step1 = cusum(x);&lt;BR /&gt;Step2 = 0 // Step1[1:nrow(Step1)-1,ncol(Step1)];&lt;BR /&gt;Output = Step1 - repeat(Step2,1,ncol(Step1));&lt;BR /&gt;return(Output);&lt;BR /&gt;Finish rowcumsum;&lt;BR /&gt;do i = 1 to 1; *number of quarters;&lt;BR /&gt;Pre_cycle_adj = TM[(1+8*(i-1)):(8*i),1:8]; print Pre_cycle_adj;&lt;BR /&gt;Cum_TM = rowcumsum(Pre_cycle_adj); print Cum_TM;&lt;BR /&gt;z_inv = probit(Cum_TM[1:8,1:7]); print z_inv;&lt;BR /&gt;end;&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;</description>
      <pubDate>Fri, 01 Oct 2021 00:17:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Need-help-with-probit-function/m-p/771521#M30969</guid>
      <dc:creator>phongpham</dc:creator>
      <dc:date>2021-10-01T00:17:03Z</dc:date>
    </item>
    <item>
      <title>Re: Need help with probit function.</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Need-help-with-probit-function/m-p/771526#M30970</link>
      <description>&lt;P&gt;Read the documentation:&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;DIV class="xis-refDictEntry"&gt;
&lt;DIV class="xis-syntax"&gt;
&lt;DIV class="xis-syntaxDescription"&gt;
&lt;DIV class="xis-requiredArgGroup"&gt;
&lt;H3 id="p1915eipsqb3qen18iin3ouowl5l" class="xis-title"&gt;Required Argument&lt;/H3&gt;
&lt;DIV id="n03zpqk76uvqmln1smctth1bh9la" class="xis-argDescriptionPair"&gt;
&lt;H4 class="xis-argument"&gt;&lt;SPAN class="xis-userSuppliedValue"&gt;p&lt;/SPAN&gt;&lt;/H4&gt;
&lt;DIV class="xis-argumentDescription"&gt;
&lt;P class="xis-paraSimpleFirst"&gt;is a numeric probability.&lt;/P&gt;
&lt;TABLE class="xis-summary"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD class="xis-summaryRange"&gt;Range&lt;/TD&gt;
&lt;TD class="xis-summaryText"&gt;0 &amp;lt; &lt;SPAN class="xis-userSuppliedValue"&gt;p&lt;/SPAN&gt; &amp;lt; 1&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;The reason that 0 and 1 are excluded is because the normal distribution for probability 0 would be negative infinity and the 1 would be from positive infinity.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So you have to test the value of P before giving the function a 0 or 1 value. Assign whatever value you want for the result when the parameter would be either 0 or 1.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 01 Oct 2021 00:34:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Need-help-with-probit-function/m-p/771526#M30970</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2021-10-01T00:34:18Z</dc:date>
    </item>
    <item>
      <title>Re: Need help with probit function.</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Need-help-with-probit-function/m-p/771535#M30972</link>
      <description>HI Ballardw, thank you very much for your help! Very much appreciate that!</description>
      <pubDate>Fri, 01 Oct 2021 03:26:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Need-help-with-probit-function/m-p/771535#M30972</guid>
      <dc:creator>phongpham</dc:creator>
      <dc:date>2021-10-01T03:26:43Z</dc:date>
    </item>
  </channel>
</rss>

