<?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: froot in SAS/IML in SAS/IML Software and Matrix Computations</title>
    <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/froot-in-SAS-IML/m-p/976246#M6537</link>
    <description>&lt;P&gt;Thank you for your reply. The output shows that the estimator based on the Firth method always hits the lower limit of the firth_con; my understanding is that nlpqn finds an optimization, while I want to find a root. This is my primary concern: how to find the solution to the score function=0.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 02 Oct 2025 15:06:36 GMT</pubDate>
    <dc:creator>Salah</dc:creator>
    <dc:date>2025-10-02T15:06:36Z</dc:date>
    <item>
      <title>froot in SAS/IML</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/froot-in-SAS-IML/m-p/976182#M6535</link>
      <description>&lt;P&gt;Hello Rick,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to find a value for the parameter beta that satisfies the equation U_star = 0. I used nlpqn method, but the result returned is the lower limit of the constraint (0.00001). I also tried the FROOT function, but I encountered an error. Additionally, I attempted the NLPLM method, but SAS indicated that I need to provide a vector 2x1. I'm running out of options and would greatly appreciate your help. Thank you.&lt;/P&gt;</description>
      <pubDate>Wed, 01 Oct 2025 20:52:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/froot-in-SAS-IML/m-p/976182#M6535</guid>
      <dc:creator>Salah</dc:creator>
      <dc:date>2025-10-01T20:52:30Z</dc:date>
    </item>
    <item>
      <title>Re: froot in SAS/IML</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/froot-in-SAS-IML/m-p/976216#M6536</link>
      <description>&lt;P&gt;Any time you get an error it is a good idea to include the LOG with the code submitted and all of the messages generated. Copy the text from the log, open a text box on the forum using the &amp;lt;/&amp;gt; icon and paste the text. The text box prevents the forum from reformatting pasted text and to visually separate the log (or program code) from the discussion text. Also&amp;nbsp; having the code in the forum post is better than an attachment unless the code is very long.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best is to include a small data set in the form of working data step code to test the code against as well as to have an idea of the data structures or content that may be causing problems.&lt;/P&gt;</description>
      <pubDate>Thu, 02 Oct 2025 05:17:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/froot-in-SAS-IML/m-p/976216#M6536</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2025-10-02T05:17:37Z</dc:date>
    </item>
    <item>
      <title>Re: froot in SAS/IML</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/froot-in-SAS-IML/m-p/976246#M6537</link>
      <description>&lt;P&gt;Thank you for your reply. The output shows that the estimator based on the Firth method always hits the lower limit of the firth_con; my understanding is that nlpqn finds an optimization, while I want to find a root. This is my primary concern: how to find the solution to the score function=0.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 02 Oct 2025 15:06:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/froot-in-SAS-IML/m-p/976246#M6537</guid>
      <dc:creator>Salah</dc:creator>
      <dc:date>2025-10-02T15:06:36Z</dc:date>
    </item>
    <item>
      <title>Re: froot in SAS/IML</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/froot-in-SAS-IML/m-p/976254#M6538</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here is an article about the FROOT function, which contains a discussion and example:&lt;BR /&gt;&lt;A href="https://blogs.sas.com/content/iml/2014/02/05/find-the-root-of-a-function.html" target="_blank"&gt;A simple way to find the root of a function of one variable - The DO Loop&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;For your function, here is an example:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc iml;
      beta = 1;      m = 50;      k = 1;   
      seed  = 2; 

   *-------------------       Firth    -----------------------;
   start Firth_score(y) global(X, m);
      beta = y[1];
      sum_x2 = (X##2)[+];
      /*  Firth  score */
      U_star = - (12*m + 5 - 4*sum_x2/(beta**2)) / (4*beta);
      return(U_star);
   finish;
   
   Call randseed(seed);
   U=j(m,1,0);    X=j(m,1,0); 
   Call randgen(U,"uniform");
   X = Sqrt( (-2*beta**2)# log(1- U) );
   Firth_root = froot("Firth_score", {0.5 1});
   print Firth_root;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;DIV class="branch"&gt;
&lt;DIV&gt;
&lt;DIV align="center"&gt;
&lt;TABLE class="table" summary="Procedure IML: Firth_root" frame="box" rules="all" cellspacing="0" cellpadding="5"&gt;
&lt;THEAD&gt;
&lt;TR&gt;
&lt;TH class="c b header" scope="col"&gt;Firth_root&lt;/TH&gt;
&lt;/TR&gt;
&lt;/THEAD&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD class="r data"&gt;
&lt;P&gt;0.7115471&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;P&gt;You can visualize the Firth score to verify the answer:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;   /* visualize to confirm that the Firth_score is zero at root */
   betaVals = T(do(0.5, 1, 0.001)); 
   score = j(nrow(betaVals),1,.); 
   do j = 1 to nrow(betaVals);
     score[j] = Firth_score(betaVals[j]);
   end;
   title "Firth Score as a Function of Beta";
   call series(betaVals, score) grid={x y}  other="refline 0/axis=y;";&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Rick_SAS_0-1759424012865.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/110349i8B932EA11C85C9D8/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Rick_SAS_0-1759424012865.png" alt="Rick_SAS_0-1759424012865.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 02 Oct 2025 16:54:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/froot-in-SAS-IML/m-p/976254#M6538</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2025-10-02T16:54:40Z</dc:date>
    </item>
    <item>
      <title>Re: froot in SAS/IML</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/froot-in-SAS-IML/m-p/976265#M6539</link>
      <description>&lt;P&gt;Thank you so much!!&lt;/P&gt;</description>
      <pubDate>Thu, 02 Oct 2025 18:54:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/froot-in-SAS-IML/m-p/976265#M6539</guid>
      <dc:creator>Salah</dc:creator>
      <dc:date>2025-10-02T18:54:43Z</dc:date>
    </item>
  </channel>
</rss>

