<?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 QLIM - TOBIT TYPE 2 DISCRETE - CALCULATE PROBS FOR 3 STATES FOR CENSORED VARIABLE (. , 0, 1) in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/QLIM-TOBIT-TYPE-2-DISCRETE-CALCULATE-PROBS-FOR-3-STATES-FOR/m-p/500133#M25806</link>
    <description>&lt;P&gt;I used the Tobit type 2 example in the QLIM examples and modified it (below).&amp;nbsp;CREDIT is whether or not someone gets credit (converted to var Z1 in regression).&amp;nbsp;&lt;SPAN&gt;&amp;nbsp;DEFAULT&amp;nbsp;(0,1) is whether or not someone defaults given they get credit (converted to var Z2 in regression). I have an "VALIDATION" indicator variable : =0 means include in the regression; =1 means not to include in regression, but give estimates of Defaults (Z2) assuming they are given credit (Z1=1). So when V=1, z1 is assigned =1 (different than the random Credit variable), and Z2= missing (.) (different than the random Default variable). Therefore I can compare the predictions with the original Validation Defaults.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;================================================================&lt;/P&gt;
&lt;P&gt;PROBLEM&lt;/P&gt;
&lt;P&gt;I am converting this into an application and need to compute the Prob(Default=1).&amp;nbsp; I figured I should only get predictions for DEFAULT=0 or 1, but I also get predictions for &lt;SPAN&gt;DEFAULT&lt;/SPAN&gt;=.! Seems wrong because these shouldn't be in the ! But I could deal with it if I knew how to compute XBETA for &lt;SPAN&gt;DEFAULT&lt;/SPAN&gt;=.,0,1 .&amp;nbsp; I can match Prob1_Z2 (&lt;SPAN&gt;DEFAULT&lt;/SPAN&gt;=.) using the estimated BETAs but I can't find the documentation that tells me how to calculate the Prob2_Z2 or Prob3_Z2.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data a2;&lt;BR /&gt; keep x: CREDIT DEFAULT Z: VALIDATION;&lt;BR /&gt; do i = 1 to 1000;&lt;BR /&gt; x1 = rannor( 19283 ); x2 = rannor( 19283 );&amp;nbsp;x3 = rannor( 19283 );&lt;BR /&gt; u1 = rannor( 19283 );&amp;nbsp;u2 = rannor( 19283 );&lt;BR /&gt; y1t = 1 + 2 * x1 + 3 * x2 + u1;&amp;nbsp;y2t = -4 + 5 * x1 - 2 * x3 + u1*.2 + u2*X2;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;/*ACTUAL OBSERVATIONS*/ &lt;BR /&gt; if ( y1t &amp;gt; 0 ) then CREDIT = 1;&amp;nbsp;else CREDIT = 0;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;IF y2t&amp;gt;0 THEN y2x=1;ELSE y2x=0;&amp;nbsp;if ( CREDIT &amp;gt; 0 ) then DEFAULT = y2x;&amp;nbsp;else DEFAULT = .;&lt;/P&gt;
&lt;P&gt;/*CENSORED OBSERVATIONS*/&lt;BR /&gt; Z1=CREDIT; Z2=DEFAULT;&lt;BR /&gt; IF MOD(I,3)=0 THEN VALIDATION=1; ELSE VALIDATION=0;&lt;BR /&gt; /*SETUP VALIDATION OBSERVATIONS*/ IF VALIDATION=1 THEN DO; Z1=1; Z2=.;END;&lt;/P&gt;
&lt;P&gt;output;&lt;BR /&gt; end;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;/*-- Type 2 Tobit --*/&lt;BR /&gt;proc qlim data=a2 method=qn outest=MYEST COVOUT;&lt;BR /&gt; model Z1 = x1 x2 / discrete;&lt;BR /&gt; model Z2 = x1 x3 / select(Z1=1) DISCRETE;&lt;BR /&gt; HETERO Z2 ~ X2;&lt;BR /&gt; OUTPUT OUT=MYOUT PREDICTED PROB PROBALL XBETA ERRSTD;&lt;BR /&gt;run;&lt;/P&gt;</description>
    <pubDate>Sun, 30 Sep 2018 02:23:41 GMT</pubDate>
    <dc:creator>drdan</dc:creator>
    <dc:date>2018-09-30T02:23:41Z</dc:date>
    <item>
      <title>QLIM - TOBIT TYPE 2 DISCRETE - CALCULATE PROBS FOR 3 STATES FOR CENSORED VARIABLE (. , 0, 1)</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/QLIM-TOBIT-TYPE-2-DISCRETE-CALCULATE-PROBS-FOR-3-STATES-FOR/m-p/500133#M25806</link>
      <description>&lt;P&gt;I used the Tobit type 2 example in the QLIM examples and modified it (below).&amp;nbsp;CREDIT is whether or not someone gets credit (converted to var Z1 in regression).&amp;nbsp;&lt;SPAN&gt;&amp;nbsp;DEFAULT&amp;nbsp;(0,1) is whether or not someone defaults given they get credit (converted to var Z2 in regression). I have an "VALIDATION" indicator variable : =0 means include in the regression; =1 means not to include in regression, but give estimates of Defaults (Z2) assuming they are given credit (Z1=1). So when V=1, z1 is assigned =1 (different than the random Credit variable), and Z2= missing (.) (different than the random Default variable). Therefore I can compare the predictions with the original Validation Defaults.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;================================================================&lt;/P&gt;
&lt;P&gt;PROBLEM&lt;/P&gt;
&lt;P&gt;I am converting this into an application and need to compute the Prob(Default=1).&amp;nbsp; I figured I should only get predictions for DEFAULT=0 or 1, but I also get predictions for &lt;SPAN&gt;DEFAULT&lt;/SPAN&gt;=.! Seems wrong because these shouldn't be in the ! But I could deal with it if I knew how to compute XBETA for &lt;SPAN&gt;DEFAULT&lt;/SPAN&gt;=.,0,1 .&amp;nbsp; I can match Prob1_Z2 (&lt;SPAN&gt;DEFAULT&lt;/SPAN&gt;=.) using the estimated BETAs but I can't find the documentation that tells me how to calculate the Prob2_Z2 or Prob3_Z2.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data a2;&lt;BR /&gt; keep x: CREDIT DEFAULT Z: VALIDATION;&lt;BR /&gt; do i = 1 to 1000;&lt;BR /&gt; x1 = rannor( 19283 ); x2 = rannor( 19283 );&amp;nbsp;x3 = rannor( 19283 );&lt;BR /&gt; u1 = rannor( 19283 );&amp;nbsp;u2 = rannor( 19283 );&lt;BR /&gt; y1t = 1 + 2 * x1 + 3 * x2 + u1;&amp;nbsp;y2t = -4 + 5 * x1 - 2 * x3 + u1*.2 + u2*X2;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;/*ACTUAL OBSERVATIONS*/ &lt;BR /&gt; if ( y1t &amp;gt; 0 ) then CREDIT = 1;&amp;nbsp;else CREDIT = 0;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;IF y2t&amp;gt;0 THEN y2x=1;ELSE y2x=0;&amp;nbsp;if ( CREDIT &amp;gt; 0 ) then DEFAULT = y2x;&amp;nbsp;else DEFAULT = .;&lt;/P&gt;
&lt;P&gt;/*CENSORED OBSERVATIONS*/&lt;BR /&gt; Z1=CREDIT; Z2=DEFAULT;&lt;BR /&gt; IF MOD(I,3)=0 THEN VALIDATION=1; ELSE VALIDATION=0;&lt;BR /&gt; /*SETUP VALIDATION OBSERVATIONS*/ IF VALIDATION=1 THEN DO; Z1=1; Z2=.;END;&lt;/P&gt;
&lt;P&gt;output;&lt;BR /&gt; end;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;/*-- Type 2 Tobit --*/&lt;BR /&gt;proc qlim data=a2 method=qn outest=MYEST COVOUT;&lt;BR /&gt; model Z1 = x1 x2 / discrete;&lt;BR /&gt; model Z2 = x1 x3 / select(Z1=1) DISCRETE;&lt;BR /&gt; HETERO Z2 ~ X2;&lt;BR /&gt; OUTPUT OUT=MYOUT PREDICTED PROB PROBALL XBETA ERRSTD;&lt;BR /&gt;run;&lt;/P&gt;</description>
      <pubDate>Sun, 30 Sep 2018 02:23:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/QLIM-TOBIT-TYPE-2-DISCRETE-CALCULATE-PROBS-FOR-3-STATES-FOR/m-p/500133#M25806</guid>
      <dc:creator>drdan</dc:creator>
      <dc:date>2018-09-30T02:23:41Z</dc:date>
    </item>
    <item>
      <title>Re: QLIM - TOBIT TYPE 2 DISCRETE - CALCULATE PROBS FOR 3 STATES FOR CENSORED VARIABLE (. , 0, 1)</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/QLIM-TOBIT-TYPE-2-DISCRETE-CALCULATE-PROBS-FOR-3-STATES-FOR/m-p/500482#M25811</link>
      <description>Ok. So I actually identified a bug. From SAS "... [the] PROC QLIM developer ... confirmed that the behavior you are observing, that when Z1 = 1, Z2 = ., the procedure treats the missing value for Z2 as a different level, is indeed a defect in the procedure. The developer also confirmed that this defect has been fixed in the next release, SAS 9.4TS1M6. "</description>
      <pubDate>Mon, 01 Oct 2018 17:13:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/QLIM-TOBIT-TYPE-2-DISCRETE-CALCULATE-PROBS-FOR-3-STATES-FOR/m-p/500482#M25811</guid>
      <dc:creator>drdan</dc:creator>
      <dc:date>2018-10-01T17:13:17Z</dc:date>
    </item>
  </channel>
</rss>

