cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Check out the JMP® Marketplace featured Capability Explorer add-in
%3CLINGO-SUB%20id%3D%22lingo-sub-542415%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3ESalvataggio%20automatico%20delle%20equazioni%20di%20previsione%20nella%20tabella%20dati%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-542415%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3E%3CP%3ECiao%20a%20tutti%2C%3C%2FP%3E%0A%3CP%3ESto%20utilizzando%20lo%20strumento%20del%20modello%20di%20adattamento%20per%20creare%20equazioni%20di%20adattamento%20per%20un%20determinato%20sottoinsieme%20di%20dati%20che%20vorrei%20quindi%20applicare%20a%20un%20insieme%20pi%C3%B9%20ampio%20e%20misurare%20il%20valore%20RMS%20tra%20il%20valore%20previsto%20e%20quello%20effettivo.%20Ho%20231%20campioni%20unici%20(etichettati%20come%20RunID)%20e%20all'interno%20di%20ogni%20campione%20ho%202%20canali%20diversi%20che%20sto%20valutando.%20Ci%C3%B2%20porta%20a%20436%20equazioni%20di%20adattamento%20totale.%20Uso%20lo%20strumento%20Adatta%20modello%20per%20creare%20le%20436%20equazioni%20e%20posso%20esaminare%20manualmente%20ciascun%20output%20e%20salvare%20ciascuna%20delle%20equazioni%20in%20una%20colonna%20nella%20tabella%20dei%20dati.%20Quindi%20copio%20e%20incollo%20la%20formula%20per%20quella%20colonna%20nel%20mio%20set%20di%20dati%20pi%C3%B9%20ampio%20e%20misuro%20il%20%22previsto%20vs%20effettivo%22.%20Vorrei%20non%20inserire%20manualmente%20le%20equazioni%20e%20sembra%20che%20ci%20siano%20un%20paio%20di%20soluzioni%20che%20sono%20state%20pubblicate%3CA%20href%3D%22https%3A%2F%2Fcommunity.jmp.com%2Ft5%2FDiscussions%2FHow-to-Save-prediction-formula-for-different-categories-when%2Ftd-p%2F77409%22%20target%3D%22_self%22%3E%20Qui%3C%2FA%3E%20E%3CA%20href%3D%22https%3A%2F%2Fcommunity.jmp.com%2Ft5%2FDiscussions%2FHow-to-get-equation-from-fit-model%2Ftd-p%2F38180%22%20target%3D%22_self%22%3E%20Qui%3C%2FA%3E%20%2C%20ma%20non%20riesco%20a%20far%20funzionare%20nessuno%20di%20questi.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EEcco%20cosa%20ho%3A%3C%2FP%3E%0A%3CP%3EVersione%20JMP%3A%2016%3C%2FP%3E%0A%3CP%3ESto%20cercando%20di%20prevedere%20Zoffset%20dalle%20posizioni%20Xoffset%20e%20Yoffset%2C%20quindi%20dovrei%20ottenere%20un'equazione%20per%20ogni%20combinazione%20%22RunID%2FChannel%22.%3C%2FP%3E%0A%3CP%3EQuando%20eseguo%20lo%20script%20qui%20sotto%20ottengo%20questo%3A%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22rlangsner_0-1662664451338.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22rlangsner_0-1662664451338.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22rlangsner_0-1662664451338.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.jmp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F45315iC5128B6031A1930D%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22rlangsner_0-1662664451338.png%22%20alt%3D%22rlangsner_0-1662664451338.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3EStavo%20solo%20copiando%20gli%20approcci%20collegati%20sopra%2C%20ma%20deve%20esserci%20qualcosa%20di%20diverso%20nel%20mio%20codice%20che%20non%20si%20allinea%20del%20tutto.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CPRE%3E%3CCODE%20class%3D%22%20language-jsl%22%3Eobj%20%3D%20Fit%20Model(%0A%20Y(%3AZOffset)%2C%0A%20By(%3ARunID%2C%20%3AChannel%20Only%20Location)%2C%0A%20Effects(%0A%20%20%3AXOffset%2C%20%3AXOffset%20*%20%3AXOffset%2C%20%3AXOffset%20*%20%3AXOffset%20*%20%3AXOffset%2C%20%3AYOffset%2C%20%3AYOffset%20*%20%3AYOffset%2C%0A%20%20%3AYOffset%20*%20%3AYOffset%20*%20%3AYOffset%2C%20%3AXOffset%20*%20%3AYOffset%0A%20)%2C%0A%20Personality(%22Standard%20Least%20Squares%22)%2C%0A%20Emphasis(%22Minimal%20Report%22)%2C%0A%20Run(%0A%20%20%3AZOffset%20%26lt%3B%26lt%3B%20%7BSummary%20of%20Fit(1)%2C%20Analysis%20of%20Variance(1)%2C%20Parameter%20Estimates(1)%2C%20Lack%20of%20Fit(0)%2C%20Scaled%20Estimates(0)%2C%0A%20%20Plot%20Actual%20by%20Predicted(0)%2C%20Plot%20Regression(0)%2C%20Plot%20Residual%20by%20Predicted(0)%2C%20Plot%20Studentized%20Residuals(0)%2C%0A%20%20Plot%20Effect%20Leverage(0)%2C%20Plot%20Residual%20by%20Normal%20Quantiles(0)%2C%20Box%20Cox%20Y%20Transformation(0)%7D%0A%20)%0A)%3B%0Aobj%20%26lt%3B%26lt%3B%20(Fit%5B1%5D%20%26lt%3B%26lt%3B%20Save%20Prediction%20Formula)%3B%3C%2FCODE%3E%3C%2FPRE%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-542415%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3E%3CLINGO-LABEL%3EScripting%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-542679%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3EOggetto%3A%20salvataggio%20automatico%20delle%20equazioni%20di%20previsione%20nella%20tabella%20dati%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-542679%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3E%3CP%3ECaro%3CA%20href%3D%22https%3A%2F%2Fcommunity.jmp.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F43473%22%20target%3D%22_blank%22%3E%20%40rlangsner%3C%2FA%3E%20%2C%20oltre%20a%20Jarmo%2C%20si%20prega%20di%20avvisare%20che%20il%20ritorno%20del%20modello%20di%20esecuzione%20%C3%A8%20un%20elenco%20in%20caso%20di%20utilizzo%20di%20un%20gruppo%2C%20vedere%20l'esempio%20seguente.%3C%2FP%3E%0A%3CPRE%3E%3CCODE%20class%3D%22%20language-jsl%22%3ENames%20Default%20To%20Here(%201%20)%3B%0A%0Adt%20%3D%20Open(%20%22%24SAMPLE_DATA%2FBig%20Class.jmp%22%20)%3B%0A%0Aobj%20%3D%20dt%20%26lt%3B%26lt%3B%20fit%20model(%20Y(%20%3Aweight%20)%2C%20effects(%20%3Aage%2C%20%3Aheight%20)%2C%20Personality(%20%22Standard%20Least%20Squares%22%20))%3B%0Amod1%20%3D%20obj%20%26lt%3B%26lt%3B%20run%3B%0Amod1%20%26lt%3B%26lt%3B%20prediction%20formula%3B%0A%0Aobj_by%20%3D%20dt%20%26lt%3B%26lt%3B%20fit%20model(%20Y(%20%3Aweight%20)%2C%20by(%20%3Asex%20)%2C%20effects(%20%3Aage%2C%20%3Aheight%20)%2C%20Personality(%20%22Standard%20Least%20Squares%22%20)%20)%3B%0Amod2%20%3D%20obj_by%20%26lt%3B%26lt%3B%20run%3B%0AFor%20Each(%20%7Bvalue%7D%2C%20mod2%2C%20value%20%26lt%3B%26lt%3B%20prediction%20formula%20)%3B%3C%2FCODE%3E%3C%2FPRE%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-542611%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3EOggetto%3A%20salvataggio%20automatico%20delle%20equazioni%20di%20previsione%20nella%20tabella%20dati%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-542611%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3E%3CP%3ECiao%20Jarmo%2C%3C%2FP%3E%3CP%3EGrazie.%20Ho%20aggiornato%20lo%20scripto%20dicendo%20semplicemente%20%22obj%20%26lt%3B%26lt%3B%20Prediction%20Formula%22%20e%20questo%20ha%20salvato%20le%20informazioni%20in%20una%20nuova%20colonna%20nel%20mio%20set%20di%20dati.Ecco%20quali%20erano%20le%20opzioni%20nel%20mio%20menu%20a%20discesa%3A%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22rlangsner_0-1662668359052.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22rlangsner_0-1662668359052.png%22%20style%3D%22width%3A%20378px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22rlangsner_0-1662668359052.png%22%20style%3D%22width%3A%20378px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.jmp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F45326i39325B066A093F25%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22rlangsner_0-1662668359052.png%22%20alt%3D%22rlangsner_0-1662668359052.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-542474%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3EOggetto%3A%20salvataggio%20automatico%20delle%20equazioni%20di%20previsione%20nella%20tabella%20dati%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-542474%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3E%3CP%3EPotrebbe%20essere%20necessario%20utilizzare%20un%20messaggio%20diverso.%20Controlla%20quali%20opzioni%20ottieni%20dal%20menu%20del%20triangolo%20rosso%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22jthi_0-1662665619097.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22jthi_0-1662665619097.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22jthi_0-1662665619097.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.jmp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F45320i2C3FCCA8DF2FB0FC%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22jthi_0-1662665619097.png%22%20alt%3D%22jthi_0-1662665619097.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CPRE%3E%3CCODE%20class%3D%22%20language-jsl%22%3ENames%20Default%20To%20Here(1)%3B%0Adt%20%3D%20Open(%22%24SAMPLE_DATA%2FAnimals.jmp%22)%3B%0A%0Aobj%20%3D%20dt%20%26lt%3B%26lt%3B%20Fit%20Model(%0A%20Y(%3Amiles)%2C%0A%20Effects(%3Aspecies%2C%20%3Asubject%5B%3Aspecies%5D%20%26amp%3B%20Random%2C%20%3Aseason%2C%20%3Aspecies%20*%20%3Aseason)%2C%0A%20Personality(Standard%20Least%20Squares)%2C%0A%20Run(%0A%20%20%3AZOffset%20%26lt%3B%26lt%3B%20%7BSummary%20of%20Fit(1)%2C%20Analysis%20of%20Variance(1)%2C%20Parameter%20Estimates(1)%2C%20Lack%20of%20Fit(0)%2C%20Scaled%20Estimates(0)%2C%0A%20%20Plot%20Actual%20by%20Predicted(0)%2C%20Plot%20Regression(0)%2C%20Plot%20Residual%20by%20Predicted(0)%2C%20Plot%20Studentized%20Residuals(0)%2C%0A%20%20Plot%20Effect%20Leverage(0)%2C%20Plot%20Residual%20by%20Normal%20Quantiles(0)%2C%20Box%20Cox%20Y%20Transformation(0)%7D%0A%20)%0A)%3B%0A%0Aobj%20%26lt%3B%26lt%3B%20Prediction%20Formula%3B%3C%2FCODE%3E%3C%2FPRE%3E%3C%2FLINGO-BODY%3E
Choose Language Hide Translation Bar
rlangsner
Level II

Saving Prediction Equations into Data Table Automatically

Hi all,

I am using the fit model tool to create fit equations for a certain subset of data that I would then like to apply back to a larger set and measure the RMS value between the predicted and actual value. I have 231 unique samples (labeled as RunID) and within each sample I have 2 different channels that I am evaluating. This leads to 436 total fit equations. I use the Fit Model tool to create the 436 equations and I can manually go through each output and save each of the equations to a column in the data table. I then copy and paste the formula for that column back into my larger data set and measure the "predicted vs actual". I would like to not manually insert the equations and it seems like there are a couple of solutions that have been posted here and here, but I can't seem to get either of these to work. 

 

Here is what I have:

JMP Version: 16

I am trying to predict the Zoffset from the Xoffset and Yoffset positions, so I should be getting an equation for each "RunID/Channel" combination. 

When I run the script below I get this:

rlangsner_0-1662664451338.png

I was just copying the approaches linked above, but there must be somethign different in my code that does not quite line up. 

 

obj = Fit Model(
	Y(:ZOffset),
	By(:RunID, :Channel Only Location),
	Effects(
		:XOffset, :XOffset * :XOffset, :XOffset * :XOffset * :XOffset, :YOffset, :YOffset * :YOffset,
		:YOffset * :YOffset * :YOffset, :XOffset * :YOffset
	),
	Personality("Standard Least Squares"),
	Emphasis("Minimal Report"),
	Run(
		:ZOffset << {Summary of Fit(1), Analysis of Variance(1), Parameter Estimates(1), Lack of Fit(0), Scaled Estimates(0),
		Plot Actual by Predicted(0), Plot Regression(0), Plot Residual by Predicted(0), Plot Studentized Residuals(0),
		Plot Effect Leverage(0), Plot Residual by Normal Quantiles(0), Box Cox Y Transformation(0)}
	)
);
obj << (Fit[1] << Save Prediction Formula);
3 REPLIES 3
jthi
Super User

Re: Saving Prediction Equations into Data Table Automatically

You might have to use different message. Check what options you get from red triangle menu

jthi_0-1662665619097.png

 

Names Default To Here(1);
dt = Open("$SAMPLE_DATA/Animals.jmp");

obj = dt << Fit Model(
	Y(:miles),
	Effects(:species, :subject[:species] & Random, :season, :species * :season),
	Personality(Standard Least Squares),
	Run(
		:ZOffset << {Summary of Fit(1), Analysis of Variance(1), Parameter Estimates(1), Lack of Fit(0), Scaled Estimates(0),
		Plot Actual by Predicted(0), Plot Regression(0), Plot Residual by Predicted(0), Plot Studentized Residuals(0),
		Plot Effect Leverage(0), Plot Residual by Normal Quantiles(0), Box Cox Y Transformation(0)}
	)
);

obj << Prediction Formula;
-Jarmo
rlangsner
Level II

Re: Saving Prediction Equations into Data Table Automatically

Hi Jarmo,

Thank you. I updated the scripto just say "obj << Prediction Formula" and that saved the information to a new column in my data set.  Here is what the options were in my dropdown:

rlangsner_0-1662668359052.png

 

Georg
Level VII

Re: Saving Prediction Equations into Data Table Automatically

Dear @rlangsner , in addition to Jarmo, please notify, that the return of run model is a list in case of using a by group, see below example.

Names Default To Here( 1 );

dt = Open( "$SAMPLE_DATA/Big Class.jmp" );

obj = dt << fit model( Y( :weight ), effects( :age, :height ), Personality( "Standard Least Squares" ));
mod1 = obj << run;
mod1 << prediction formula;

obj_by = dt << fit model( Y( :weight ), by( :sex ), effects( :age, :height ), Personality( "Standard Least Squares" ) );
mod2 = obj_by << run;
For Each( {value}, mod2, value << prediction formula );
Georg