<?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: Populate Summary table with Main &amp;amp; StdDev confidence intervals in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Populate-Summary-table-with-Main-amp-StdDev-confidence-intervals/m-p/762014#M94033</link>
    <description>&lt;P&gt;Hi Jarmo,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Yes I tried the above script and it runs smoothly and fast on a big datafile.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks so much!!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;-Voiz&lt;/P&gt;</description>
    <pubDate>Wed, 29 May 2024 22:27:41 GMT</pubDate>
    <dc:creator>Voizingu</dc:creator>
    <dc:date>2024-05-29T22:27:41Z</dc:date>
    <item>
      <title>Populate Summary table with Main &amp; StdDev confidence intervals</title>
      <link>https://community.jmp.com/t5/Discussions/Populate-Summary-table-with-Main-amp-StdDev-confidence-intervals/m-p/761829#M93968</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;I am trying to generate a Summary table from a main datatable.&lt;/DIV&gt;&lt;DIV&gt;So far I was able to put all metrics in Column 1 with grouping (column 2).&lt;/DIV&gt;&lt;DIV&gt;I could then populate with Count, Mean, StdDev, +4sigma, -4sigma.&lt;/DIV&gt;&lt;DIV&gt;Next step is to add the confidence interval (95%) for Mean and STD: the same way it is done in the following analysis :&lt;/DIV&gt;&lt;DIV&gt;Fit Y by X &amp;gt; Means and Std Dev.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;I could run ALL the analysis one-by-one with a FOR() loop and use DisplayBox to pick each values and populate my Summary data table, but I really would rather not, it would slow down the analysis by A LOT since I usually deal with 1000+ metrics and 10000+ rows.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Thanks in advance for your help&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;-Voiz&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Attached my script that calls BIG CLASS.JMP as an example&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );
clear symbols();
Deletesymbols();

dt = Open( "$SAMPLE_DATA/Big Class.jmp" );

SplitBy = "sex";

//Get a list from all unique configs
summarize(ColumnSplitBy=by(Column (dt, SplitBy)));
show(ColumnSplitBy);
For( i = N Items( ColumnSplitBy ), i &amp;gt; 0, i--,
  If( ColumnSplitBy[i] == "",
  Remove From( ColumnSplitBy, i, 1 );
  )
);

//Get only numeric Columns
MetricCols = dt &amp;lt;&amp;lt; Get Column Names( numeric, continuous );

//Create a new table to collect the stats from the "Test" table
CpkTable = New Table( "Summary Table",
	New Column( "Metric", "Character", "Nominal" ),
	New Column( SplitBy, "Character", "Nominal" ),
	New Column( "N", "Numeric", "Continuous" ),
	New Column( "LSL", "Numeric", "Continuous" ),
	New Column( "USL", "Numeric", "Continuous" ),
	New Column( "Mean", "Numeric", "Continuous" ),
	New Column( "StdDev", "Numeric", "Continuous" ),
	New Column( "+4σ", "Numeric", "Continuous", formula(:Mean + :StdDev * 4) ),
	New Column( "-4σ", "Numeric", "Continuous", formula(:Mean - :StdDev * 4) ),	
);

show(MetricCols);

for(i=1,i &amp;lt;= N Items(MetricCols) ,i++,
	show(i);
	
	// Calculate Stats
	Summarize(dt, exg = by(Column (dt, SplitBy)), 
	exc = Count((Column (dt, Eval(Eval Expr(Expr(Char(MetricCols[i]))))))),
	exm = Mean((Column (dt, Eval(Eval Expr(Expr(Char(MetricCols[i]))))))),
	exstd = StdDev((Column (dt, Eval(Eval Expr(Expr(Char(MetricCols[i]))))))),	
	);

	Limits = Column(dt,MetricCols[i]) &amp;lt;&amp;lt; GetProperty ("Speclimits"); 

	//Loop to run through all configs and fill the table
	For( j= 1 ,j &amp;lt;= NItems(ColumnSplitBy) , j++,
		Show(j );

		y = Eval Expr(
			CpkTable &amp;lt;&amp;lt; AddRows(
				{:Metric = Expr(Char( MetricCols[i] ) ) ;
				As Column(Splitby) = Expr(Char( ColumnSplitBy[j] ) ) ;
				:LSL= Expr(Try(Limits["LSL"]));
				:USL= Expr(Try(Limits["USL"]));
				:N= exc[j];
				:Mean= exm[j];
				:StdDev= exstd[j];
			};)
		);
		
		Print(y);
		Try(Eval(y));

	); //For j */
); //For i&lt;/CODE&gt;&lt;/PRE&gt;&lt;/DIV&gt;</description>
      <pubDate>Tue, 28 May 2024 03:41:38 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Populate-Summary-table-with-Main-amp-StdDev-confidence-intervals/m-p/761829#M93968</guid>
      <dc:creator>Voizingu</dc:creator>
      <dc:date>2024-05-28T03:41:38Z</dc:date>
    </item>
    <item>
      <title>Re: Populate Summary table with Main &amp; StdDev confidence intervals</title>
      <link>https://community.jmp.com/t5/Discussions/Populate-Summary-table-with-Main-amp-StdDev-confidence-intervals/m-p/761832#M93971</link>
      <description>&lt;P&gt;I'm not sure what is "a lot" in your case, but I would still first try using&amp;nbsp;fit y by x platform.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Open it with as little as possible AND open it as invisible report (or private depending on your jmp version). After you have extracted the values close it.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here(1);

dt = Open("$SAMPLE_DATA/Probe.jmp", invisible);

cont_cols = dt &amp;lt;&amp;lt; Get Column Names("Continuous", "String");

start = Tick Seconds();
For Each({cont_col}, cont_cols,
	fit = dt &amp;lt;&amp;lt; Oneway(
		Y(Eval(cont_col)),
		X(:Site),
		Invisible
	);

	tb_vals = Report(fit)[Outline Box("Means and Std Deviations"), Table Box(1)] &amp;lt;&amp;lt; get;
	fit &amp;lt;&amp;lt; close window;
	// save results from tb_vals
);

end = Tick Seconds();
show(end - start);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 28 May 2024 05:07:55 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Populate-Summary-table-with-Main-amp-StdDev-confidence-intervals/m-p/761832#M93971</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2024-05-28T05:07:55Z</dc:date>
    </item>
    <item>
      <title>Re: Populate Summary table with Main &amp; StdDev confidence intervals</title>
      <link>https://community.jmp.com/t5/Discussions/Populate-Summary-table-with-Main-amp-StdDev-confidence-intervals/m-p/761834#M93972</link>
      <description>&lt;P&gt;My response did not answer the question&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;
&lt;/CODE&gt;&amp;nbsp;&amp;nbsp;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 28 May 2024 12:43:34 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Populate-Summary-table-with-Main-amp-StdDev-confidence-intervals/m-p/761834#M93972</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2024-05-28T12:43:34Z</dc:date>
    </item>
    <item>
      <title>Re: Populate Summary table with Main &amp; StdDev confidence intervals</title>
      <link>https://community.jmp.com/t5/Discussions/Populate-Summary-table-with-Main-amp-StdDev-confidence-intervals/m-p/761889#M93997</link>
      <description>&lt;P&gt;Hello Jarmo,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks a lot, it takes between 8 and 10s for the script to run, which is great since PROBE.JMP is quite a heavy file.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Do you have a trick to populate a Summary table with "&lt;STRONG&gt;tb_vals"&lt;/STRONG&gt; for each metrics and grouping? I tried to do it each value at a time and my script is now super slow. Is there a way to populate a whole matrix into a table in a fast way?&lt;/P&gt;</description>
      <pubDate>Tue, 28 May 2024 17:57:53 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Populate-Summary-table-with-Main-amp-StdDev-confidence-intervals/m-p/761889#M93997</guid>
      <dc:creator>Voizingu</dc:creator>
      <dc:date>2024-05-28T17:57:53Z</dc:date>
    </item>
    <item>
      <title>Re: Populate Summary table with Main &amp; StdDev confidence intervals</title>
      <link>https://community.jmp.com/t5/Discussions/Populate-Summary-table-with-Main-amp-StdDev-confidence-intervals/m-p/761898#M94002</link>
      <description>&lt;P&gt;suI assume you wish to extract all of these for each of the Levels&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jthi_0-1716920679267.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/64560i0CA77827E00BB053/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jthi_0-1716920679267.png" alt="jthi_0-1716920679267.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I think this might be even faster (at least it is easier to script)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here(1);

dt = Open("$SAMPLE_DATA/Probe.jmp", invisible);

cont_cols = dt &amp;lt;&amp;lt; Get Column Names("Continuous", "String");

ow = dt &amp;lt;&amp;lt; Oneway(
	Y(Eval(cont_cols)),
	X(:Site),
	Means and Std Dev(1),
	SendToReport(
		Dispatch(
			{"Means and Std Deviations"},
			"Std Dev Lower 95%",
			NumberColBox,
			{Visibility("Visible")}
		),
		Dispatch(
			{"Means and Std Deviations"},
			"Std Dev Upper 95%",
			NumberColBox,
			{Visibility("Visible")}
		)
	),
	Invisible
);

tb = Report(ow[1])[Outline Box("Means and Std Deviations"), Table Box(1)];
dt_stats = tb &amp;lt;&amp;lt; Make Combined Data Table;
tb &amp;lt;&amp;lt; close window;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;CODE class=" language-jsl"&gt;&lt;/CODE&gt;You can run Oneway for all of your columns at the same time WITH Means and Std Dev enabled (and "hidden" columns visible), get reference to first table box and then use &amp;lt;&amp;lt; Make Combined Data Table. You will get result like this&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jthi_2-1716921037152.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/64563iD1351A0AB3071D45/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jthi_2-1716921037152.png" alt="jthi_2-1716921037152.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;You should then be able to use Update to add those columns you need to your final table.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If this doesn't work out for some reason, looping will and there are few options how you can do that. Use &amp;lt;&amp;lt; Make Into Data Table and Update OR get the results from the table box into lists (&amp;lt;&amp;lt; Get might be enough) and update your data using lists + data table subscripting.&lt;/P&gt;</description>
      <pubDate>Tue, 28 May 2024 18:33:27 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Populate-Summary-table-with-Main-amp-StdDev-confidence-intervals/m-p/761898#M94002</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2024-05-28T18:33:27Z</dc:date>
    </item>
    <item>
      <title>Re: Populate Summary table with Main &amp; StdDev confidence intervals</title>
      <link>https://community.jmp.com/t5/Discussions/Populate-Summary-table-with-Main-amp-StdDev-confidence-intervals/m-p/762014#M94033</link>
      <description>&lt;P&gt;Hi Jarmo,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Yes I tried the above script and it runs smoothly and fast on a big datafile.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks so much!!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;-Voiz&lt;/P&gt;</description>
      <pubDate>Wed, 29 May 2024 22:27:41 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Populate-Summary-table-with-Main-amp-StdDev-confidence-intervals/m-p/762014#M94033</guid>
      <dc:creator>Voizingu</dc:creator>
      <dc:date>2024-05-29T22:27:41Z</dc:date>
    </item>
  </channel>
</rss>

