- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
General script for fit model with saving student residuals for different variables
I am trying to create a script that I can use every time with minimum work to do ANOVA and Chi-sq directly.
I started the script:
Names Default To Here(1);
dt=Current Data Table();
dlg = Column Dialog(
name = ColList( "Parameters", Min Col(1) ),
subject = ColList( "Treatment", Min Col(1), MaxCol(1) ),
Reffect = ColList( "Random", Min Col(0), MaxCol(2) )
);
// Stop if the user did not press 'OK'
If( dlg["Button"] != 1, Beep(); Throw());
name = dlg[ "name" ];
subject = dlg["subject"];
Reffect = dlg ["Reffect"];
show (name, subject, Reffect);
dt<<Fit Model(
Y( name[1]),
Effects( subject[1]),
Random Effects( Reffect[1]),
NoBounds( 1 ),
Personality( "Standard Least Squares" ),
Method( "REML" ),
Emphasis( "Effect Leverage" ),
Run(
Profiler( 0 ),
name[1] << {Summary of Fit( 1 ), Analysis of Variance( 0 ),
Parameter Estimates( 1 ), Scaled Estimates( 0 ),
Plot Actual by Predicted( 1 ), Plot Residual by Predicted( 1 ),
Plot Studentized Residuals( 0 ), Plot Effect Leverage( 1 ),
Plot Residual by Normal Quantiles( 0 ), Interaction Plots( 0 ), AICc( 0 ),
Show VIF( 0 )}
)
);
obj << Studentized Residuals;
//obj << Close Window;
However, there is an issue to do the fit model. The fit model box open only with the Y.
on the Y most of the time I need to add more than 1 variable as well, so I will have more student residuals to save to be able to verify the outliers, then the normal distribuition and the equal variance.
Thanks for your help
1 ACCEPTED SOLUTION
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: General script for fit model with saving student residuals for different variables
Created:
Jan 17, 2025 09:59 AM
| Last Modified: Jan 17, 2025 12:19 PM
(303 views)
| Posted in reply to message from Bmllnn 01-16-2025
Hi,
Try adjusting the code to add eval(eval expr(expr))). There's a blog post here that explains a little about how this works. Also, the way the column dialog window is set up allows multiple Ys to be selected.
Eval(Eval Expr(obj=dt<<Fit Model(
Y( expr(name)),
Effects( expr(subject)),
Random Effects( expr(Reffect)),
NoBounds( 1 ),
Personality( "Standard Least Squares" ),
Method( "REML" ),
Emphasis( "Effect Leverage" ),
Run(
Profiler( 0 ),
name[1] << {Summary of Fit( 1 ), Analysis of Variance( 0 ),
Parameter Estimates( 1 ), Scaled Estimates( 0 ),
Plot Actual by Predicted( 1 ), Plot Residual by Predicted( 1 ),
Plot Studentized Residuals( 0 ), Plot Effect Leverage( 1 ),
Plot Residual by Normal Quantiles( 0 ), Interaction Plots( 0 ), AICc( 0 ),
Show VIF( 0 )}
)
)));
1 REPLY 1
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: General script for fit model with saving student residuals for different variables
Created:
Jan 17, 2025 09:59 AM
| Last Modified: Jan 17, 2025 12:19 PM
(304 views)
| Posted in reply to message from Bmllnn 01-16-2025
Hi,
Try adjusting the code to add eval(eval expr(expr))). There's a blog post here that explains a little about how this works. Also, the way the column dialog window is set up allows multiple Ys to be selected.
Eval(Eval Expr(obj=dt<<Fit Model(
Y( expr(name)),
Effects( expr(subject)),
Random Effects( expr(Reffect)),
NoBounds( 1 ),
Personality( "Standard Least Squares" ),
Method( "REML" ),
Emphasis( "Effect Leverage" ),
Run(
Profiler( 0 ),
name[1] << {Summary of Fit( 1 ), Analysis of Variance( 0 ),
Parameter Estimates( 1 ), Scaled Estimates( 0 ),
Plot Actual by Predicted( 1 ), Plot Residual by Predicted( 1 ),
Plot Studentized Residuals( 0 ), Plot Effect Leverage( 1 ),
Plot Residual by Normal Quantiles( 0 ), Interaction Plots( 0 ), AICc( 0 ),
Show VIF( 0 )}
)
)));