<?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: How to get the half evaluated form of a prediction equation in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/How-to-get-the-half-evaluated-form-of-a-prediction-equation/m-p/668203#M85633</link>
    <description>&lt;P&gt;That is slick, great question&amp;nbsp;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/92"&gt;@pauldeen&lt;/a&gt;&amp;nbsp;and great solution&amp;nbsp;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/14366"&gt;@jthi&lt;/a&gt;&amp;nbsp;!&lt;/P&gt;</description>
    <pubDate>Tue, 15 Aug 2023 14:13:10 GMT</pubDate>
    <dc:creator>ih</dc:creator>
    <dc:date>2023-08-15T14:13:10Z</dc:date>
    <item>
      <title>How to get the half evaluated form of a prediction equation</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-get-the-half-evaluated-form-of-a-prediction-equation/m-p/667205#M85528</link>
      <description>&lt;P&gt;I am using fit model to built a regression equation for time and a bunch of extra factors. The end goal is to create a table in a journal that has the prediction equation evaluated for all the extra factors and show the pure intercept + slope * time based equation. Example:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt = Open("$SAMPLE_DATA\Powder Metallurgy.jmp");
fm = dt &amp;lt;&amp;lt; Fit Model(
	Y( :Shrinkage ),
	Effects(
		:Formation Method, :Compaction Method, :Sintering Time
	),
	Personality( "Standard Least Squares" ),
	Emphasis( "Effect Leverage" ),
	Run()
);
PredForm = Arg(Arg((FM &amp;lt;&amp;lt; GetPredictionFormula), 3),1);&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;This results in equation:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;0.942161598883733 + Match( :Formation Method,
	"Die", 0.0407171588498178,
	"Extrusion", 0.0256123252434345,
	"Isostatic", -0.0663294840932524,
	.
) + Match( :Compaction Method,
	"Cold", 0.594574663098895,
	"Warm", -0.594574663098895,
	.
) + -0.0742413463542265 * :Sintering Time&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;We can then create a table with the extra factors:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dtEquations = dt &amp;lt;&amp;lt; Summary(
	Group( :Formation Method, :Compaction Method ),
	Freq( "None" ),
	Weight( "None" )
);
dtEquations &amp;lt;&amp;lt; DeleteColumns(:N Rows);&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;And so how do I write the equation into a new column where it looks at the (in this example) first 2 columns and evaluates the Match statements, with simplicfication, but leaves the equation for time? End goal:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="pauldeen_0-1691659449029.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/55697i062FC46060CCC5D0/image-size/medium?v=v2&amp;amp;px=400" role="button" title="pauldeen_0-1691659449029.png" alt="pauldeen_0-1691659449029.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Even better if all the static coefficients are reduced to one.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The whole thing needs to be dynamic for multiple extra factor levels, and the equation could common slope, common intercept or it could be different slopes and or different intercepts.&lt;/P&gt;</description>
      <pubDate>Thu, 10 Aug 2023 09:34:49 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-get-the-half-evaluated-form-of-a-prediction-equation/m-p/667205#M85528</guid>
      <dc:creator>pauldeen</dc:creator>
      <dc:date>2023-08-10T09:34:49Z</dc:date>
    </item>
    <item>
      <title>Re: How to get the half evaluated form of a prediction equation</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-get-the-half-evaluated-form-of-a-prediction-equation/m-p/667709#M85592</link>
      <description>&lt;P&gt;This will most likely require quite a lot of modification, but one option would be to use Extract Expr&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here(1);

dt = Open("$SAMPLE_DATA\Powder Metallurgy.jmp");
fm = dt &amp;lt;&amp;lt; Fit Model(
	Y(:Shrinkage),
	Effects(:Formation Method, :Compaction Method, :Sintering Time),
	Personality("Standard Least Squares"),
	Emphasis("Effect Leverage"),
	Run()
);

dtEquations = dt &amp;lt;&amp;lt; Summary(Group(:Formation Method, :Compaction Method), Freq("None"), Weight("None"));

dtEquations &amp;lt;&amp;lt; New Column("Sintering Time", Character, Continuous, &amp;lt;&amp;lt; Set Each Value(
	PredForm = Arg(Arg((FM &amp;lt;&amp;lt; GetPredictionFormula), 3), 1);
	PredForm = Substitute(Name Expr(PredForm), Extract Expr(PredForm, Match(Wild List())), Eval(Extract Expr(PredForm, Match(Wild List()))));
	PredForm = Substitute(Name Expr(PredForm), Extract Expr(PredForm, Match(Wild List())), Eval(Extract Expr(PredForm, Match(Wild List()))));
	Char(Name Expr(PredForm));
));

&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 13 Aug 2023 18:11:42 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-get-the-half-evaluated-form-of-a-prediction-equation/m-p/667709#M85592</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2023-08-13T18:11:42Z</dc:date>
    </item>
    <item>
      <title>Re: How to get the half evaluated form of a prediction equation</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-get-the-half-evaluated-form-of-a-prediction-equation/m-p/668092#M85626</link>
      <description>&lt;P&gt;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/14366"&gt;@jthi&lt;/a&gt;&amp;nbsp;brilliant, thank you!&lt;/P&gt;&lt;P&gt;I added a simplify expr to the last block to reduce all coefficients to one but otherwise solution was perfect.&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dtEquations &amp;lt;&amp;lt; New Column("Sintering Time", Character, Continuous, &amp;lt;&amp;lt; Set Each Value(
	PredForm = Arg(Arg((FM &amp;lt;&amp;lt; GetPredictionFormula), 3), 1);
	PredForm = Substitute( Name Expr( PredForm ),
		Extract Expr( PredForm, Match( Wild List() ) ), Eval( Extract Expr( PredForm, Match( Wild List() ) ) )
	);
	PredForm = Substitute( Name Expr( PredForm ),
		Extract Expr( PredForm, Match( Wild List() ) ), Eval( Extract Expr( PredForm, Match( Wild List() ) ) )
	);
	Char(Simplify Expr(Name Expr(PredForm)));
));&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 15 Aug 2023 06:45:33 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-get-the-half-evaluated-form-of-a-prediction-equation/m-p/668092#M85626</guid>
      <dc:creator>pauldeen</dc:creator>
      <dc:date>2023-08-15T06:45:33Z</dc:date>
    </item>
    <item>
      <title>Re: How to get the half evaluated form of a prediction equation</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-get-the-half-evaluated-form-of-a-prediction-equation/m-p/668203#M85633</link>
      <description>&lt;P&gt;That is slick, great question&amp;nbsp;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/92"&gt;@pauldeen&lt;/a&gt;&amp;nbsp;and great solution&amp;nbsp;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/14366"&gt;@jthi&lt;/a&gt;&amp;nbsp;!&lt;/P&gt;</description>
      <pubDate>Tue, 15 Aug 2023 14:13:10 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-get-the-half-evaluated-form-of-a-prediction-equation/m-p/668203#M85633</guid>
      <dc:creator>ih</dc:creator>
      <dc:date>2023-08-15T14:13:10Z</dc:date>
    </item>
  </channel>
</rss>

