<?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: Graph Builder Add p Values dynamically: recommended workflow in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Graph-Builder-Add-p-Values-dynamically-recommended-workflow/m-p/250107#M49102</link>
    <description>&lt;P&gt;Generally, JMP makes rearranging data easy, and 'inefficient' is a relative term. If I understand correctly, you want to add some results from one (analysis) platform to those from another (graphical) platform. The best workflow will depend on the details.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The script below makes some random data in line with what you say above. If you could run it, then post the script that will reproduce the results from your two chosen platforms, folks will be better able to give more specific recommendations.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;NamesDefaultToHere(1);

// Make a data table
nr = 1000;
y = J(nr, 200, RandomNormal());
x = J(nr, 1, RandomUniform(1, 10));
o = J(nr, 1, RandomInteger(1, 6));
dt = AsTable(x||o||y);
dt &amp;lt;&amp;lt; setName("Test");
Column(dt, 1) &amp;lt;&amp;lt; setName("X");
Column(dt, 2) &amp;lt;&amp;lt; setName("Overlay");&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Mon, 02 Mar 2020 16:14:34 GMT</pubDate>
    <dc:creator>ian_jmp</dc:creator>
    <dc:date>2020-03-02T16:14:34Z</dc:date>
    <item>
      <title>Graph Builder Add p Values dynamically: recommended workflow</title>
      <link>https://community.jmp.com/t5/Discussions/Graph-Builder-Add-p-Values-dynamically-recommended-workflow/m-p/249866#M49067</link>
      <description>&lt;P&gt;Hi JMP community,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I often need to annotate Graph Builder plots (~200) with the results of an analysis (e.g. p Values. Estimates). So far, I have mostly relied on manual annotations but I'm starting to be tired of this approach. I know how to add text dynamically via scripting but I have not figured out a good way to solve my specific problem (see below)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What would be your recommended workflow in the following case:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;U&gt;Graph Data&lt;/U&gt;: ~200 columns containing the Y values (~1,000 rows); X data define in 1 column, Overlay data in 1 column, yielding 200 plots&lt;/P&gt;&lt;P&gt;&lt;U&gt;Analysis results&lt;/U&gt;: 1 row per Y value, columns containing the p Value, Estimates, and other possible analysis outputs.&lt;/P&gt;&lt;P&gt;&lt;U&gt;Note&lt;/U&gt;: Automation has been challenging because the initial data is always slightly different from one batch to another.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My main problem is that the &lt;U&gt;graph data&lt;/U&gt; and &lt;U&gt;analysis results&lt;/U&gt; tables are organized orthogonally (Y in columns vs. Y in rows) which would require transposing the result table, split the resulting table by analysis outputs (p Values, Estimates,...)&amp;nbsp; and connect the resulting table to the Graph Table. This does not seem very efficient so any suggestions would be welcome.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;TS&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 09 Jun 2023 23:26:15 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Graph-Builder-Add-p-Values-dynamically-recommended-workflow/m-p/249866#M49067</guid>
      <dc:creator>Thierry_S</dc:creator>
      <dc:date>2023-06-09T23:26:15Z</dc:date>
    </item>
    <item>
      <title>Re: Graph Builder Add p Values dynamically: recommended workflow</title>
      <link>https://community.jmp.com/t5/Discussions/Graph-Builder-Add-p-Values-dynamically-recommended-workflow/m-p/250107#M49102</link>
      <description>&lt;P&gt;Generally, JMP makes rearranging data easy, and 'inefficient' is a relative term. If I understand correctly, you want to add some results from one (analysis) platform to those from another (graphical) platform. The best workflow will depend on the details.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The script below makes some random data in line with what you say above. If you could run it, then post the script that will reproduce the results from your two chosen platforms, folks will be better able to give more specific recommendations.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;NamesDefaultToHere(1);

// Make a data table
nr = 1000;
y = J(nr, 200, RandomNormal());
x = J(nr, 1, RandomUniform(1, 10));
o = J(nr, 1, RandomInteger(1, 6));
dt = AsTable(x||o||y);
dt &amp;lt;&amp;lt; setName("Test");
Column(dt, 1) &amp;lt;&amp;lt; setName("X");
Column(dt, 2) &amp;lt;&amp;lt; setName("Overlay");&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 02 Mar 2020 16:14:34 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Graph-Builder-Add-p-Values-dynamically-recommended-workflow/m-p/250107#M49102</guid>
      <dc:creator>ian_jmp</dc:creator>
      <dc:date>2020-03-02T16:14:34Z</dc:date>
    </item>
    <item>
      <title>Re: Graph Builder Add p Values dynamically: recommended workflow</title>
      <link>https://community.jmp.com/t5/Discussions/Graph-Builder-Add-p-Values-dynamically-recommended-workflow/m-p/250140#M49106</link>
      <description>&lt;P&gt;Find attached 3 files:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;Input data table as generated with your script (minor modification)&lt;/LI&gt;&lt;LI&gt;An example of OUTPUT table&lt;/LI&gt;&lt;LI&gt;An Example of PLOTS journal&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;Thank you for looking into this.&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;TS&lt;/P&gt;</description>
      <pubDate>Mon, 02 Mar 2020 16:56:42 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Graph-Builder-Add-p-Values-dynamically-recommended-workflow/m-p/250140#M49106</guid>
      <dc:creator>Thierry_S</dc:creator>
      <dc:date>2020-03-02T16:56:42Z</dc:date>
    </item>
    <item>
      <title>Re: Graph Builder Add p Values dynamically: recommended workflow</title>
      <link>https://community.jmp.com/t5/Discussions/Graph-Builder-Add-p-Values-dynamically-recommended-workflow/m-p/250360#M49135</link>
      <description>&lt;P&gt;I'm sure everyone would approach this slightly differently. But if the two tables above are your starting point, then I would do something like this:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;NamesDefaultToHere(1);

// Data tables
data = DataTable("Test WORKFLOW.jmp");
stats = DataTable("Test WORKFLOW RESULT TABLE.jmp");

// Template expression for Graph Builder with text annotation
gbExpr =
Expr(
	data &amp;lt;&amp;lt; Graph Builder(
	Show Control Panel( 0 ),
	Variables( X( :X ), Y( yTBD ), Overlay( :Overlay ) ),
	Elements(Line(X, Y, Legend( 12 ), Error Interval( "None" ))),
	SendToReport(
		Dispatch(
			{},
			"Graph Builder",
			FrameBox,
			{Add Graphics Script( 2, Description( "Annotation" ), Text( {8, 0}, "interaction P Val: "||Char(Round(pValTBD, 3))))}
			)
		)
	)
);

// Loop over 'Y' variables
lub = LineUpBox(NCol(1));
for(c=3, c&amp;lt;=NCol(data), c++,
	yCol = Column(data, c);
	pVal = Column(stats, 2)[c-2];
	lub &amp;lt;&amp;lt; append(Eval(Substitute(NameExpr(gbExpr), Expr(yTBD), yCol, Expr(pValTBD), pVal)));
	);

// Reports in a Journal
nw = NewWindow("Report", &amp;lt;&amp;lt;Journal, lub);
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;You should be able to develop this outline to suit your case. You could also try including some logic to place the annotation in a 'better' place. If you are not sure how it works, then see 'Help &amp;gt; Scripting Guide' and the JSL book.&lt;/P&gt;</description>
      <pubDate>Tue, 03 Mar 2020 10:46:37 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Graph-Builder-Add-p-Values-dynamically-recommended-workflow/m-p/250360#M49135</guid>
      <dc:creator>ian_jmp</dc:creator>
      <dc:date>2020-03-03T10:46:37Z</dc:date>
    </item>
  </channel>
</rss>

