<?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: Editing a formula in JMP script in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Editing-a-formula-in-JMP-script/m-p/46908#M26728</link>
    <description>&lt;P&gt;Awesome!! Thanks&amp;nbsp;&lt;A href="https://community.jmp.com/t5/user/viewprofilepage/user-id/3605" target="_blank"&gt;ian&lt;/A&gt;&amp;nbsp;!!&lt;/P&gt;</description>
    <pubDate>Wed, 08 Nov 2017 18:55:14 GMT</pubDate>
    <dc:creator>akrishna39</dc:creator>
    <dc:date>2017-11-08T18:55:14Z</dc:date>
    <item>
      <title>Editing a formula in JMP script</title>
      <link>https://community.jmp.com/t5/Discussions/Editing-a-formula-in-JMP-script/m-p/46881#M26708</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I have a very long formula stored in a variable named f. Now, I have to create a new column where I paste the formula b0 + b1*f. If I do it the following way, it works, but when I try to see the formula by right clicking on the column, I see "&amp;nbsp;&lt;SPAN&gt;b0 + b1*f " as my formula. I wanted to see the expression of f stored in 'f' in the formula and not just the letter 'f'. Please help. Thanks!!&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;test_data&amp;lt;&amp;lt;NewColumn("response_hat");
Column( Data Table( "test_data" ), "response_hat" ) &amp;lt;&amp;lt; Set Formula( Name Expr( b0 + b1*f ) );&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 08 Nov 2017 04:46:52 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Editing-a-formula-in-JMP-script/m-p/46881#M26708</guid>
      <dc:creator>akrishna39</dc:creator>
      <dc:date>2017-11-08T04:46:52Z</dc:date>
    </item>
    <item>
      <title>Re: Editing a formula in JMP script</title>
      <link>https://community.jmp.com/t5/Discussions/Editing-a-formula-in-JMP-script/m-p/46882#M26709</link>
      <description>&lt;P&gt;The constants b0 and b1 inside Name Expr() are causing the problem.&amp;nbsp; That function needs a variable that &lt;EM&gt;contains&lt;/EM&gt; an expression rather than an expression.&amp;nbsp; Try putting the entire formula inside f and then call Name Expr( f :(&lt;/img&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt = Open("$SAMPLE_DATA/iris.jmp");

f = Expr( 1 + 2 );
g = Expr( 1 + 2 + 3 );

dt &amp;lt;&amp;lt; New Column( "new", formula( name expr( f ) ) );
Column( dt, "new" ) &amp;lt;&amp;lt; Set Formula( name expr( g ) );&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 08 Nov 2017 05:40:09 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Editing-a-formula-in-JMP-script/m-p/46882#M26709</guid>
      <dc:creator>ih</dc:creator>
      <dc:date>2017-11-08T05:40:09Z</dc:date>
    </item>
    <item>
      <title>Re: Editing a formula in JMP script</title>
      <link>https://community.jmp.com/t5/Discussions/Editing-a-formula-in-JMP-script/m-p/46883#M26710</link>
      <description>&lt;P&gt;Thanks&amp;nbsp;&lt;A href="https://community.jmp.com/t5/user/viewprofilepage/user-id/6657" target="_blank"&gt;ih&lt;/A&gt;. But my question is how to put&lt;SPAN&gt;&amp;nbsp;entire formula inside f?&lt;/SPAN&gt;&amp;nbsp;For example, in your script, if you wanted to create a new column having the formula f+g, how will you do it? And if I right click on that new column, it should show me "1 + 2 + 1 + 2 + 3", instead of "f + g"&lt;/P&gt;</description>
      <pubDate>Wed, 08 Nov 2017 05:47:07 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Editing-a-formula-in-JMP-script/m-p/46883#M26710</guid>
      <dc:creator>akrishna39</dc:creator>
      <dc:date>2017-11-08T05:47:07Z</dc:date>
    </item>
    <item>
      <title>Re: Editing a formula in JMP script</title>
      <link>https://community.jmp.com/t5/Discussions/Editing-a-formula-in-JMP-script/m-p/46884#M26711</link>
      <description>&lt;P&gt;Now I understand and yes that is a pain.&amp;nbsp; The easiest way is probably to convert them back to strings as in h, below.&amp;nbsp; You can also do it with expressions, as in j.&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt = Open("$SAMPLE_DATA/iris.jmp");

f = Expr( 1 + 2 );
g = Expr( 1 + 2 + 3 );
h = parse(char(name expr(f)) || " + " || char(name expr(g)));
i = Expr( Expr(Name Expr(f)) + Expr(Name Expr(g)));
j = Eval Expr(i);

dt &amp;lt;&amp;lt; New Column( "new", formula( name expr( f ) ) );
Column( dt, "new" ) &amp;lt;&amp;lt; Set Formula( name expr( g ) );
dt &amp;lt;&amp;lt; New Column( "from string", formula( name expr( h ) ) );
dt &amp;lt;&amp;lt; New Column( "from expression", formula( name expr( j ) ) );&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 08 Nov 2017 06:17:52 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Editing-a-formula-in-JMP-script/m-p/46884#M26711</guid>
      <dc:creator>ih</dc:creator>
      <dc:date>2017-11-08T06:17:52Z</dc:date>
    </item>
    <item>
      <title>Re: Editing a formula in JMP script</title>
      <link>https://community.jmp.com/t5/Discussions/Editing-a-formula-in-JMP-script/m-p/46885#M26712</link>
      <description>&lt;P&gt;See below.&lt;/P&gt;</description>
      <pubDate>Wed, 08 Nov 2017 10:04:13 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Editing-a-formula-in-JMP-script/m-p/46885#M26712</guid>
      <dc:creator>ian_jmp</dc:creator>
      <dc:date>2017-11-08T10:04:13Z</dc:date>
    </item>
    <item>
      <title>Re: Editing a formula in JMP script</title>
      <link>https://community.jmp.com/t5/Discussions/Editing-a-formula-in-JMP-script/m-p/46886#M26713</link>
      <description>&lt;P&gt;Please find an alternative:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names default to here(1);

f = Expr( 1 + 2 );
g = Expr( 1 + 2 + 3 );
h = Substitute(Expr(A + B), Expr(A), NameExpr(f), Expr(B), NameExpr(g));

dt = NewTable("Sum", NewColumn("A+B", Numeric, Continuous, Formula(NameExpr(h))), AddRows(3));&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 08 Nov 2017 10:03:28 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Editing-a-formula-in-JMP-script/m-p/46886#M26713</guid>
      <dc:creator>ian_jmp</dc:creator>
      <dc:date>2017-11-08T10:03:28Z</dc:date>
    </item>
    <item>
      <title>Re: Editing a formula in JMP script</title>
      <link>https://community.jmp.com/t5/Discussions/Editing-a-formula-in-JMP-script/m-p/46908#M26728</link>
      <description>&lt;P&gt;Awesome!! Thanks&amp;nbsp;&lt;A href="https://community.jmp.com/t5/user/viewprofilepage/user-id/3605" target="_blank"&gt;ian&lt;/A&gt;&amp;nbsp;!!&lt;/P&gt;</description>
      <pubDate>Wed, 08 Nov 2017 18:55:14 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Editing-a-formula-in-JMP-script/m-p/46908#M26728</guid>
      <dc:creator>akrishna39</dc:creator>
      <dc:date>2017-11-08T18:55:14Z</dc:date>
    </item>
    <item>
      <title>Re: Editing a formula in JMP script</title>
      <link>https://community.jmp.com/t5/Discussions/Editing-a-formula-in-JMP-script/m-p/46909#M26729</link>
      <description>&lt;P&gt;This is cool!! Thanks&amp;nbsp;&lt;A href="https://community.jmp.com/t5/user/viewprofilepage/user-id/6657" target="_blank"&gt;ih&lt;/A&gt;&amp;nbsp;!!! :)&lt;/img&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 08 Nov 2017 18:55:55 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Editing-a-formula-in-JMP-script/m-p/46909#M26729</guid>
      <dc:creator>akrishna39</dc:creator>
      <dc:date>2017-11-08T18:55:55Z</dc:date>
    </item>
  </channel>
</rss>

