<?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 Fit Group and Fit Y by X in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Fit-Group-and-Fit-Y-by-X/m-p/684353#M87009</link>
    <description>&lt;P&gt;Hello! I'm attempting to script an analysis where the user inputs a data table, and the script runs a fit Y by X with a user selected column through a column dialog box as Y and all other columns (which can be any mix of continuous and nominal variables) as the X selections. Is there a way to use fit Y by X and Fit Group together to get this all-in-one window and easily allow for the results to be ordered by goodness of fit?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This is a script I wrote that outputs them all in one box, but I want the user to easily find the significant fits by ANOVA. Ideally, I would like to output significant fits to a tabular report window, but that is above my knowledge right now. Any help would be appreciated!&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );
dt = Current Data Table();
dlg = Column Dialog(
	iv = ColList( "Depedent Variable",
		Min Col( 1 ),
		Max Col( 1 ),
		Data Type( "Numeric" )
	)
);
If( dlg["Button"] != 1,
	Beep();
	Throw();
);
iv = dlg["iv"];
n_cols = N Cols( dt );
New Window( "Report",
	H List Box(
		For( c = 1, c &amp;lt;= n_cols, c++,
			Fit Y by X(
				Y( Column( iv[1] ) ),
				X( Column( c ) ),
				Fit Line( 1 ),
				Anova( 1 )
			)
		)
	)
);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 05 Oct 2023 22:16:40 GMT</pubDate>
    <dc:creator>kbatch</dc:creator>
    <dc:date>2023-10-05T22:16:40Z</dc:date>
    <item>
      <title>Fit Group and Fit Y by X</title>
      <link>https://community.jmp.com/t5/Discussions/Fit-Group-and-Fit-Y-by-X/m-p/684353#M87009</link>
      <description>&lt;P&gt;Hello! I'm attempting to script an analysis where the user inputs a data table, and the script runs a fit Y by X with a user selected column through a column dialog box as Y and all other columns (which can be any mix of continuous and nominal variables) as the X selections. Is there a way to use fit Y by X and Fit Group together to get this all-in-one window and easily allow for the results to be ordered by goodness of fit?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This is a script I wrote that outputs them all in one box, but I want the user to easily find the significant fits by ANOVA. Ideally, I would like to output significant fits to a tabular report window, but that is above my knowledge right now. Any help would be appreciated!&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );
dt = Current Data Table();
dlg = Column Dialog(
	iv = ColList( "Depedent Variable",
		Min Col( 1 ),
		Max Col( 1 ),
		Data Type( "Numeric" )
	)
);
If( dlg["Button"] != 1,
	Beep();
	Throw();
);
iv = dlg["iv"];
n_cols = N Cols( dt );
New Window( "Report",
	H List Box(
		For( c = 1, c &amp;lt;= n_cols, c++,
			Fit Y by X(
				Y( Column( iv[1] ) ),
				X( Column( c ) ),
				Fit Line( 1 ),
				Anova( 1 )
			)
		)
	)
);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 05 Oct 2023 22:16:40 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Fit-Group-and-Fit-Y-by-X/m-p/684353#M87009</guid>
      <dc:creator>kbatch</dc:creator>
      <dc:date>2023-10-05T22:16:40Z</dc:date>
    </item>
    <item>
      <title>Re: Fit Group and Fit Y by X</title>
      <link>https://community.jmp.com/t5/Discussions/Fit-Group-and-Fit-Y-by-X/m-p/684397#M87013</link>
      <description>&lt;P&gt;The script below, runs the Fit Y by X and then output the Summary of Fit table for all of the analyses.&amp;nbsp; I hope this is what you want.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );
dt = Current Data Table();
dlg = Column Dialog(
	iv = ColList( "Depedent Variable",
		Min Col( 1 ),
		Max Col( 1 ),
		Data Type( "Numeric" )//,
		//modeling type(ordinal,nominal)
	)
);
If( dlg["Button"] != 1,
	Beep();
	Throw();
);
iv = Char( dlg["iv"][1] );

// Get the names of all of the columns in the data table
colNameList = dt &amp;lt;&amp;lt; get column names( string );
// Remove the Dependent Column from the list
Remove From( colNameList, Contains( colNameList, iv ), 1 );


ft = Fit Y by X(
	Y( Column( iv ) ),
	X( Eval( colNameList ) ),
	Fit Line( 1 ),
	Anova( 1 )
);
(ft &amp;lt;&amp;lt; report)[1]["Summary of Fit", Table Box( 1 )] &amp;lt;&amp;lt; make combined data table;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Here are a couple of notes:&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;When you post JSL, please use the JSL icon to open the JSL window and copy the code into that window.&amp;nbsp; It allows for a cleaner display of the entry.&lt;/LI&gt;
&lt;LI&gt;You need to take the time to read the Scripting Guide, which is available in the JMP Documentation Library, under the Help pull down menu.&lt;/LI&gt;
&lt;LI&gt;The Column Dialog() structure has been depreciated.&amp;nbsp; You need to move to using a New Window with a Col List Box().&lt;/LI&gt;
&lt;/OL&gt;</description>
      <pubDate>Fri, 06 Oct 2023 00:21:29 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Fit-Group-and-Fit-Y-by-X/m-p/684397#M87013</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2023-10-06T00:21:29Z</dc:date>
    </item>
    <item>
      <title>Re: Fit Group and Fit Y by X</title>
      <link>https://community.jmp.com/t5/Discussions/Fit-Group-and-Fit-Y-by-X/m-p/684527#M87029</link>
      <description>&lt;P&gt;Thank you very much!&lt;/P&gt;</description>
      <pubDate>Fri, 06 Oct 2023 14:00:05 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Fit-Group-and-Fit-Y-by-X/m-p/684527#M87029</guid>
      <dc:creator>kbatch</dc:creator>
      <dc:date>2023-10-06T14:00:05Z</dc:date>
    </item>
  </channel>
</rss>

