<?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: Matched Pair analysis: tabulate the t statistics; multiple Y responses in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Matched-Pair-analysis-tabulate-the-t-statistics-multiple-Y/m-p/530708#M75395</link>
    <description>&lt;P&gt;See if this helps you along&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="txnelson_0-1659662131429.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/44590i0F3D8694AFC136B2/image-size/medium?v=v2&amp;amp;px=400" role="button" title="txnelson_0-1659662131429.png" alt="txnelson_0-1659662131429.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );
dt = Current Data Table();

colNames = dt &amp;lt;&amp;lt; get column names( continuous );

// Start final data table
dtFinal = New Table( "Final", New Column( "Comparison", character ) );

For( i = 2, i &amp;lt;= N Items( colNames ), i++,
	platform = Data Table( "Matched_Pair_by_Group" ) &amp;lt;&amp;lt;
	Matched Pairs(
		invisible,
		SendToByGroup( {:GroupBy == "ProteinA"} ),
		Y( colNames[1], colNames[i] ),
		By( :GroupBy )
	);
	Wait( 0 );

    // Make combined data table
	dtCombined = Report( platform[1] )[Table Box( 1 )] &amp;lt;&amp;lt; Make Combined Data Table;
 
    // Close report window
	Report( platform[1] ) &amp;lt;&amp;lt; Close Window;

    // Keep only the Prob &amp;gt; |t| rows
	dtCombined &amp;lt;&amp;lt; select where( :column 4 != "Prob &amp;gt; |t|" );
	dtCombined &amp;lt;&amp;lt; delete rows;
	
	// Add the comparison column
	dtCombined &amp;lt;&amp;lt; New Column( "Comparison",
		character,
		set each value( colNames[1] || " vs. " || colNames[i] )
	);

    // Add the data table to the Final data table
	dtFinal &amp;lt;&amp;lt; concatenate( dtCombined, Append to first table( 1 ) );

    // Delete the Combined table
	Close( dtCombined, nosave );
);&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Fri, 05 Aug 2022 01:16:02 GMT</pubDate>
    <dc:creator>txnelson</dc:creator>
    <dc:date>2022-08-05T01:16:02Z</dc:date>
    <item>
      <title>Matched Pair analysis: tabulate the t statistics; multiple Y responses</title>
      <link>https://community.jmp.com/t5/Discussions/Matched-Pair-analysis-tabulate-the-t-statistics-multiple-Y/m-p/530669#M75390</link>
      <description>&lt;P&gt;Hello JMP Community,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For context and in case this helps with Google indexing, this is a use case from a proteomic experiment, and the individual "measurements" in the attached example file represents individual peptide measurement.&amp;nbsp; &amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The Matched Pair analysis already gives me the answer I need (&lt;A href="https://www.jmp.com/support/help/en/16.2/#page/jmp/matched-pairs-analysis.shtml#" target="_blank"&gt;Matched Pairs Analysis (jmp.com))&amp;nbsp;&lt;/A&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Group by "GroupBy"&lt;/LI&gt;&lt;LI&gt;Matching two conditions at a time (e.g. Drug00 vs. Drug01, Drug00 vs. Drug02, Drug00 vs. Drug03)&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, since I really just need the two-tailed t test p-value, I currently have to:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Go through &lt;EM&gt;&lt;STRONG&gt;Analyze &amp;gt;&amp;gt; Specialized Modeling &amp;gt;&amp;gt; Matched Pairs&lt;/STRONG&gt;&lt;/EM&gt;&lt;/LI&gt;&lt;LI&gt;Select two Y columns at a time (e.g. Drug00 and Drug01)&lt;/LI&gt;&lt;LI&gt;by the column &lt;EM&gt;&lt;STRONG&gt;GroupBy&lt;/STRONG&gt;&lt;/EM&gt;&lt;/LI&gt;&lt;LI&gt;Wait for output with plots and all the t statistics&lt;/LI&gt;&lt;LI&gt;Make &lt;EM&gt;&lt;STRONG&gt;Combined Data Table&lt;/STRONG&gt;&lt;/EM&gt;&lt;/LI&gt;&lt;LI&gt;Sort by Column 4&lt;/LI&gt;&lt;LI&gt;Scroll down to "&lt;EM&gt;&lt;STRONG&gt;Prob &amp;gt; |t|&lt;/STRONG&gt;&lt;/EM&gt;"&lt;/LI&gt;&lt;LI&gt;Select all rows with "Prob &amp;gt; |t|" in Column 4&lt;/LI&gt;&lt;LI&gt;Invert select, then delete selected rows&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;U&gt;Question 1:&lt;/U&gt;&lt;/P&gt;&lt;P&gt;Is there a way to go through JSL or otherwise, to simply tabulate either all the statistical outputs (e.g. Mean Difference, Std Error, Upper/Lower 95%, Prob &amp;gt; |t|), or better yet, just &lt;EM&gt;&lt;STRONG&gt;Prob &amp;gt; |t|&lt;/STRONG&gt;&lt;/EM&gt; ?&amp;nbsp; I don't know how to get started, since unlike the Graph Builder, I can't figure out how to "Save Script".&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;U&gt;Question 2:&lt;/U&gt;&lt;/P&gt;&lt;P&gt;Getting "Question 1" resolved would go a long way for me already, but is there a way to do multiple Matched Pair analysis (i.e. &lt;EM&gt;&lt;STRONG&gt;Drug00 vs Drug01&lt;/STRONG&gt;&lt;/EM&gt;, &lt;EM&gt;&lt;STRONG&gt;Drug00 vs. Drug02&lt;/STRONG&gt;&lt;/EM&gt;, &lt;EM&gt;&lt;STRONG&gt;Drug00 vs. Drug03&lt;/STRONG&gt;&lt;/EM&gt;)?&lt;/P&gt;&lt;P&gt;Analyze &amp;gt;&amp;gt; Screening &amp;gt;&amp;gt; Response Screening seems to be what I'm looking for.&amp;nbsp; &lt;A href="https://www.jmp.com/support/help/en/16.2/#page/jmp/launch-the-response-screening-platform.shtml?os=win&amp;amp;source=application#ww219179" target="_blank"&gt;Launch the Response Screening Platform (jmp.com)&lt;/A&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;EM&gt;&lt;STRONG&gt;Drug01&lt;/STRONG&gt;&lt;/EM&gt;, &lt;EM&gt;&lt;STRONG&gt;Drug02&lt;/STRONG&gt;&lt;/EM&gt;, and &lt;EM&gt;&lt;STRONG&gt;Drug03&lt;/STRONG&gt;&lt;/EM&gt; as &lt;EM&gt;&lt;STRONG&gt;Y, Response&lt;/STRONG&gt;&lt;/EM&gt;&lt;/LI&gt;&lt;LI&gt;&lt;EM&gt;&lt;STRONG&gt;Drug00 &lt;/STRONG&gt;&lt;/EM&gt;as &lt;EM&gt;&lt;STRONG&gt;X&lt;/STRONG&gt;&lt;/EM&gt;&lt;/LI&gt;&lt;LI&gt;&lt;EM&gt;&lt;STRONG&gt;Grouping&amp;nbsp;&lt;/STRONG&gt;&lt;/EM&gt;by&amp;nbsp;&lt;STRONG&gt;GroupBy&lt;/STRONG&gt;&lt;/LI&gt;&lt;LI&gt;&lt;STRONG&gt;Checked:&lt;/STRONG&gt;&amp;nbsp; &lt;STRONG&gt;PValues Table on Launch&lt;/STRONG&gt; and &lt;STRONG&gt;Paired X and Y&lt;/STRONG&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;However, it's not clear to me what the &lt;EM&gt;&lt;STRONG&gt;PValue&lt;/STRONG&gt;&lt;/EM&gt; column in the output represents.&lt;/P&gt;&lt;P&gt;In addition, the &lt;EM&gt;&lt;STRONG&gt;PValue&lt;/STRONG&gt;&lt;/EM&gt; from the Response Screening workflow doesn't correspond to and seem to be smaller than any of the one- or two-tailed p-values I get through the &lt;EM&gt;&lt;STRONG&gt;Matched Pair Analysis&lt;/STRONG&gt;&lt;/EM&gt; work flow; the &lt;EM&gt;&lt;STRONG&gt;Prob &amp;gt; |t| &lt;/STRONG&gt;&lt;/EM&gt;values&amp;nbsp;from the &lt;EM&gt;&lt;STRONG&gt;Matched Pair Analysis &lt;/STRONG&gt;&lt;/EM&gt;workflow&amp;nbsp;seems more reasonable.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for your advice.&lt;/P&gt;</description>
      <pubDate>Sat, 10 Jun 2023 23:52:35 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Matched-Pair-analysis-tabulate-the-t-statistics-multiple-Y/m-p/530669#M75390</guid>
      <dc:creator>rtool</dc:creator>
      <dc:date>2023-06-10T23:52:35Z</dc:date>
    </item>
    <item>
      <title>Re: Matched Pair analysis: tabulate the t statistics; multiple Y responses</title>
      <link>https://community.jmp.com/t5/Discussions/Matched-Pair-analysis-tabulate-the-t-statistics-multiple-Y/m-p/530708#M75395</link>
      <description>&lt;P&gt;See if this helps you along&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="txnelson_0-1659662131429.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/44590i0F3D8694AFC136B2/image-size/medium?v=v2&amp;amp;px=400" role="button" title="txnelson_0-1659662131429.png" alt="txnelson_0-1659662131429.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );
dt = Current Data Table();

colNames = dt &amp;lt;&amp;lt; get column names( continuous );

// Start final data table
dtFinal = New Table( "Final", New Column( "Comparison", character ) );

For( i = 2, i &amp;lt;= N Items( colNames ), i++,
	platform = Data Table( "Matched_Pair_by_Group" ) &amp;lt;&amp;lt;
	Matched Pairs(
		invisible,
		SendToByGroup( {:GroupBy == "ProteinA"} ),
		Y( colNames[1], colNames[i] ),
		By( :GroupBy )
	);
	Wait( 0 );

    // Make combined data table
	dtCombined = Report( platform[1] )[Table Box( 1 )] &amp;lt;&amp;lt; Make Combined Data Table;
 
    // Close report window
	Report( platform[1] ) &amp;lt;&amp;lt; Close Window;

    // Keep only the Prob &amp;gt; |t| rows
	dtCombined &amp;lt;&amp;lt; select where( :column 4 != "Prob &amp;gt; |t|" );
	dtCombined &amp;lt;&amp;lt; delete rows;
	
	// Add the comparison column
	dtCombined &amp;lt;&amp;lt; New Column( "Comparison",
		character,
		set each value( colNames[1] || " vs. " || colNames[i] )
	);

    // Add the data table to the Final data table
	dtFinal &amp;lt;&amp;lt; concatenate( dtCombined, Append to first table( 1 ) );

    // Delete the Combined table
	Close( dtCombined, nosave );
);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 05 Aug 2022 01:16:02 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Matched-Pair-analysis-tabulate-the-t-statistics-multiple-Y/m-p/530708#M75395</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2022-08-05T01:16:02Z</dc:date>
    </item>
    <item>
      <title>Re: Matched Pair analysis: tabulate the t statistics; multiple Y responses</title>
      <link>https://community.jmp.com/t5/Discussions/Matched-Pair-analysis-tabulate-the-t-statistics-multiple-Y/m-p/530856#M75401</link>
      <description>&lt;P&gt;Tested your script on 133K rows and 10 conditions, and got both Questions resolved.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I did have to edit &lt;STRONG&gt;&lt;EM&gt;ProteinA&lt;/EM&gt;&lt;/STRONG&gt;, and will take time to learn what that actually does later.&lt;/P&gt;&lt;PRE class="language-jsl"&gt;&lt;CODE&gt;SendToByGroup( {:GroupBy == "ProteinA"} ),&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&amp;nbsp;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/2687"&gt;@txnelson&lt;/a&gt;&amp;nbsp;!&lt;/P&gt;</description>
      <pubDate>Fri, 05 Aug 2022 13:31:09 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Matched-Pair-analysis-tabulate-the-t-statistics-multiple-Y/m-p/530856#M75401</guid>
      <dc:creator>rtool</dc:creator>
      <dc:date>2022-08-05T13:31:09Z</dc:date>
    </item>
    <item>
      <title>Re: Matched Pair analysis: tabulate the t statistics; multiple Y responses</title>
      <link>https://community.jmp.com/t5/Discussions/Matched-Pair-analysis-tabulate-the-t-statistics-multiple-Y/m-p/530954#M75411</link>
      <description>&lt;P&gt;The ProteinA line is an error.&amp;nbsp; Just delete the whole line.&lt;/P&gt;</description>
      <pubDate>Fri, 05 Aug 2022 16:16:56 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Matched-Pair-analysis-tabulate-the-t-statistics-multiple-Y/m-p/530954#M75411</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2022-08-05T16:16:56Z</dc:date>
    </item>
    <item>
      <title>Re: Matched Pair analysis: tabulate the t statistics; multiple Y responses</title>
      <link>https://community.jmp.com/t5/Discussions/Matched-Pair-analysis-tabulate-the-t-statistics-multiple-Y/m-p/531349#M75450</link>
      <description>&lt;P&gt;If I am correctly understanding your question, the more complete analysis is a mixed model. You will have three columns in your data set. GroupBy (character, nominal), Drug (character, nominal), and&amp;nbsp; the peptide measurement (numeric, continuous).&amp;nbsp; Using the Fit Model platform, Y is your peptide measurement, then put Drug and GroupBy in as Model Effects.&amp;nbsp; Then, using the "Attributes" pull down triangle, set GroupBy as "Random Effect" (and leave "Unbounded Variance Components" checked, with "Emphasis" set to "Effect Screening").&amp;nbsp; With the usual assumptions of homoskedasticity&amp;nbsp;etc, this is a generalized version of the Matched Pairs Analysis that extends to two or more groups (drugs in your case). In fact, you can verify this by applying this mixed model with only two of the drugs. The results will be identical to the Matched Pairs results for those two drugs. The benefits of using this mixed model are many. Among them are: More power for each comparison, and all the capability of the fit model platform is at your disposal (multiple comparisons, variance components, etc).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Mark&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 08 Aug 2022 11:18:16 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Matched-Pair-analysis-tabulate-the-t-statistics-multiple-Y/m-p/531349#M75450</guid>
      <dc:creator>MRB3855</dc:creator>
      <dc:date>2022-08-08T11:18:16Z</dc:date>
    </item>
    <item>
      <title>Re: Matched Pair analysis: tabulate the t statistics; multiple Y responses</title>
      <link>https://community.jmp.com/t5/Discussions/Matched-Pair-analysis-tabulate-the-t-statistics-multiple-Y/m-p/533171#M75600</link>
      <description>&lt;P&gt;Thanks for the suggestion, &lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/7073"&gt;@MRB3855&lt;/a&gt;&amp;nbsp;.&lt;/P&gt;&lt;P&gt;I'll confess I am not familiar with mixed model or Fit Model.&lt;/P&gt;&lt;P&gt;1) Yes, we can assume homoskedasticity, if you're mean that we expect the same variability regardless of the magnitude of the values under the columns Drug00/Drug01/Drug02/Drug03 (e.g. no need to log transform)&lt;/P&gt;&lt;P&gt;2) I have changed the attribute for "Measurement" to numeric, continuous, but I don't understand the results (attached).&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Perhaps I wasn't clear: when conducting the &lt;EM&gt;&lt;STRONG&gt;Specialized Modeling &amp;gt;&amp;gt; Matched Pairs&lt;/STRONG&gt;&lt;/EM&gt;, we populate the "&lt;STRONG&gt;By&lt;/STRONG&gt;" box with the column "&lt;STRONG&gt;GroupBy&lt;/STRONG&gt;"&amp;nbsp; (&lt;U&gt;not "X Grouping&lt;/U&gt;").&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;On a related note, could you guide me on which of the Model Types corresponds to the "Matched Pairs" analysis, if that's what you're referring to?&amp;nbsp; Thanks.&lt;/P&gt;&lt;P&gt;&lt;A href="https://www.jmp.com/support/help/en/16.2/index.shtml#page/jmp/overview-of-the-fit-model-platform.shtml" target="_blank"&gt;Overview of the Fit Model Platform (jmp.com)&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 12 Aug 2022 01:18:23 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Matched-Pair-analysis-tabulate-the-t-statistics-multiple-Y/m-p/533171#M75600</guid>
      <dc:creator>rtool</dc:creator>
      <dc:date>2022-08-12T01:18:23Z</dc:date>
    </item>
    <item>
      <title>Re: Matched Pair analysis: tabulate the t statistics; multiple Y responses</title>
      <link>https://community.jmp.com/t5/Discussions/Matched-Pair-analysis-tabulate-the-t-statistics-multiple-Y/m-p/533652#M75651</link>
      <description>&lt;P&gt;Thanks for the detail.&amp;nbsp; OK...to use the Mixed model as I've described, you must stack the data first. In the end there will be four columns: GroupBy (character, nominal), Measurement (character, nominal), Drug (character, nominal), and the peptide measurement (numeric, continuous). Using the Fit Model platform, Y is your peptide measurement, then put Drug and Measurement in as Model Effects. The put GroupBy as your "By" variable.&amp;nbsp; Then, using the "Attributes" pull down triangle, set Measurement&amp;nbsp; as "Random Effect" (and leave "Unbounded Variance Components" checked, with "Emphasis" set to "Effect Screening"). This is a mixed model; it's called mixed because it contains fixed effects (drug) &lt;EM&gt;and&lt;/EM&gt; random effects (Measurement).&amp;nbsp; It is "simply" a two-way ANOVA model...a &lt;EM&gt;mixed&lt;/EM&gt; two-way ANOVA model.&lt;/P&gt;&lt;P&gt;FWIW, here are some details: &lt;A href="https://www.lexjansen.com/pharmasug/2004/Posters/PO05.pdf" target="_blank" rel="noopener"&gt;https://www.lexjansen.com/pharmasug/2004/Posters/PO05.pdf&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Mark&lt;/P&gt;</description>
      <pubDate>Mon, 15 Aug 2022 10:49:26 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Matched-Pair-analysis-tabulate-the-t-statistics-multiple-Y/m-p/533652#M75651</guid>
      <dc:creator>MRB3855</dc:creator>
      <dc:date>2022-08-15T10:49:26Z</dc:date>
    </item>
  </channel>
</rss>

