topic Fit Spline By Group: Save Spline Coefficients to Column? in Discussions
https://community.jmp.com/t5/Discussions/Fit-Spline-By-Group-Save-Spline-Coefficients-to-Column/m-p/59394#M32592
<P>Hi all--having an issue. I am using Fit Y by X to fit 5,000 separate regressions. I hold control, select red drop-down arrow, and Fit->Flexible, Fit->Spline and select, say, 0.1. This fits a spline to all 5,000 graphs with lambda of 0.1. I have 28 X values in each of 5,000 graphs, and I understand there are 4 different spline coefficients (A, B, C, D). </P><P> </P><P>I understand if I just had 1 regression, I could select "Save Coefficients" and a nifty Bx5 matrix, (where B is a subset of my X values) table will pop out with each row as an B value and columns 2-5 as the values of my spline function, for each discrete value of B. </P><P> </P><P>However, when I do this fitting "By Group" with 5,000 regressions, I get 5,000 of these tables as outputs! I would like a way to either:</P><P> </P><P>1) Get 1 table that contains all of the knot spline function values for all values of B (ie for all "By: Groups" (instead of 5000 separate tables)</P><P> </P><P>Or:</P><P>2) Be able to get Spline value A from spline function as its own column in the original datatable, get Spline value B from spline function as its own column in original datatable, etc. where spline values A, B, C, D pertain to the correct discrete B value and the correct By: Group</P><P> </P><P>I know if I just I hit Ctrl and "Save Predicteds" after Fit Y by X, there will be a column saved to the original datatable with ~5000 formulas (JMP says "Huge formula with 5000 items). It is a conditional formula that looks for the By: Group, then does Spline Eval(X, [28x5]) for each group. Is there a way I can use this script and do find/replace to extract the Spline Coefficient? Maybe there is some unique JSL thing to do? How do I get these darn coefficients???</P><P> </P><P>I also understand there is a Spline Coef(x, y, lambda) thing in JSL but I don't understand jsl syntax at all and am dimwitted in programming, in general. </P><P> </P><P>Thanks for any advice and your time.</P><P> </P>Tue, 05 Jun 2018 22:49:55 GMTM0gAl0g2018-06-05T22:49:55ZFit Spline By Group: Save Spline Coefficients to Column?
https://community.jmp.com/t5/Discussions/Fit-Spline-By-Group-Save-Spline-Coefficients-to-Column/m-p/59394#M32592
<P>Hi all--having an issue. I am using Fit Y by X to fit 5,000 separate regressions. I hold control, select red drop-down arrow, and Fit->Flexible, Fit->Spline and select, say, 0.1. This fits a spline to all 5,000 graphs with lambda of 0.1. I have 28 X values in each of 5,000 graphs, and I understand there are 4 different spline coefficients (A, B, C, D). </P><P> </P><P>I understand if I just had 1 regression, I could select "Save Coefficients" and a nifty Bx5 matrix, (where B is a subset of my X values) table will pop out with each row as an B value and columns 2-5 as the values of my spline function, for each discrete value of B. </P><P> </P><P>However, when I do this fitting "By Group" with 5,000 regressions, I get 5,000 of these tables as outputs! I would like a way to either:</P><P> </P><P>1) Get 1 table that contains all of the knot spline function values for all values of B (ie for all "By: Groups" (instead of 5000 separate tables)</P><P> </P><P>Or:</P><P>2) Be able to get Spline value A from spline function as its own column in the original datatable, get Spline value B from spline function as its own column in original datatable, etc. where spline values A, B, C, D pertain to the correct discrete B value and the correct By: Group</P><P> </P><P>I know if I just I hit Ctrl and "Save Predicteds" after Fit Y by X, there will be a column saved to the original datatable with ~5000 formulas (JMP says "Huge formula with 5000 items). It is a conditional formula that looks for the By: Group, then does Spline Eval(X, [28x5]) for each group. Is there a way I can use this script and do find/replace to extract the Spline Coefficient? Maybe there is some unique JSL thing to do? How do I get these darn coefficients???</P><P> </P><P>I also understand there is a Spline Coef(x, y, lambda) thing in JSL but I don't understand jsl syntax at all and am dimwitted in programming, in general. </P><P> </P><P>Thanks for any advice and your time.</P><P> </P>Tue, 05 Jun 2018 22:49:55 GMThttps://community.jmp.com/t5/Discussions/Fit-Spline-By-Group-Save-Spline-Coefficients-to-Column/m-p/59394#M32592M0gAl0g2018-06-05T22:49:55Z