cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • Image to Table JMP extension imports single or batch images as data tables. Useful to extract curves from pictures or convert image data to curve data to use in analyses like Functional Data Explorer. Download and install the extension.

Discussions

Solve problems, and share tips and tricks with other JMP users.
Choose Language Hide Translation Bar
TimCarrWPI
Level II

How to Model Heteroscedastic Data with Linear Relationship Between Standard Error Magnitude and Predicted Value

Hello,

I've collected data measuring the 'adhesion strength' of a 3D printed part to a plastic substrate as a function of several printing parameters. I have limited terms in my model (compared to a full 2nd order response surface design), as these are the terms found significant in a screening experiment.

When I model my data with standard least squares, my residual by predicted plot shows a clear expanding bell trend. However, when I divide the residuals by the predicted value, I get a very well-behaved set of residuals. I believe this implies that I can model standard error as a linear function of the predicted adhesion strength, but I'm not sure how to implement this.

Loglinear variance modeling might work, but it also calls for model terms for the variance when I think all I want to do is use the expected value of the mean. I've been suggested weighted least squares by Google results, but this doesn't look like something that's default implemented in JMP. What does the community suggest here? I've attached my data table.

Thank you,

Tim

6 REPLIES 6
MRB3855
Super User

Re: How to Model Heteroscedastic Data with Linear Relationship Between Standard Error Magnitude and Predicted Value

Hi @TimCarrWPI : Good info here.

https://online.stat.psu.edu/stat462/node/186/

Often, a variance stabalizing transformation (e.g., ln[Y]) is all that is needed in such cases. And for the weighted least squares (WLS)  opion...once you have a column of weights, just put weight in the "Weight" role on the Fit Model platform dialog. 

TimCarrWPI
Level II

Re: How to Model Heteroscedastic Data with Linear Relationship Between Standard Error Magnitude and Predicted Value

Thank you for the source!

Taking the natural log of my response variable seems to work, but it also converts all my units, and I'd like to show graphs in used units rather than ln(kN). I could just convert back obviously, but keeping analysis in the same units throughout would be nice (in my mind at least).

I tried using WLS, but found that it didn't help much. I'm not sure if I've implemented it wrong. I've done the following:

  • Save predicted adhesion strength (Y) and residual adhesion strength from SLS model
  • Calculate abs(residual)
  • Fit Y by X to get a LoBF and use that line's equation to calculated a "fit abs(residual)", which I believe is proportional to σ_i
  • Calculate weights as σ_i^2
  • Re-run SLS with weights (WLS)

Now here is where I'm encountering an issue. My WLS analysis shows a residual graph that doesn't look much better than my SLS analysis. The Penn State source says that I need to plot standardized residuals, but JMP doesn't have a built-in option for this. I see other JMP forum posts suggesting to calculate standardized residuals as: residuals / Col Std Dev(residuals), but this would just scale my bad-looking residual graph and doesn't actually incorporate weights in any way. It seems to me that this estimate of standardized residuals relies on the assumption that variance is constant, which isn't true here right?

How do I actually get standardized residuals here?

Best,

Tim

shampton82
Level VIII

Re: How to Model Heteroscedastic Data with Linear Relationship Between Standard Error Magnitude and Predicted Value

Hey @TimCarrWPI ,

Try using the box-cox Y transformation in Fit model under the Factor profiling menu option.  It will keep all the units in a non-transformed state.

 

Steve

TimCarrWPI
Level II

Re: How to Model Heteroscedastic Data with Linear Relationship Between Standard Error Magnitude and Predicted Value

Thank you for the suggestion. I think the real question I've been working around all day is just...

I have all these models that proport to handle heteroscedasticity, and they all give me similar estimations of the predicted outcome. However, they all disagree quite a lot on the model variance, and therefore they report different significant model terms. How do I actually select a "best" model to use here? What qualities should I be looking for?

shampton82
Level VIII

Re: How to Model Heteroscedastic Data with Linear Relationship Between Standard Error Magnitude and Predicted Value

I'm a big fan of letting the models vote, generally a true effect will show up the most on average across a bunch of different models.  If you save the prediction formula from the models, then make a formula column that takes their average you can then use the Ave formula column in the "Profiler" graph and expand intermediate formulas to see the relationships from the model averages:

shampton82_0-1795135231952.png

shampton82_1-1795135394873.png

 

Victor_G
Super User

Re: How to Model Heteroscedastic Data with Linear Relationship Between Standard Error Magnitude and Predicted Value

To complete the suggestion from @shampton82, you can compare the performances of different models using the platfrom Model Comparison. This way, no matter how or with which estimation methods the models have been built, you can compare them with the same metrics (example here with standard least squares, standard least squares with box-cox transformation, loglinear variance model and Generalized regression model with Normal Pruned Forward estimation method):

Victor_G_0-1795162718332.png

As you already pointed out, if you're only interested about the mean response, these models are very close to each others in terms of performances. In this platform, you can use the option "Model averaging" to see if this model averaging can have better performances than individual models (but here it's not the case):

Victor_G_1-1795162844045.png

You can also compare the magnitude of the residuals between the models (but again, they are very close between models).

When using the Profiler in this platform, you can also use the option Assess Variable Importance (Independant uniform Inputs as your data comes from a DOE without any specific constraints) to better compare how the different models evaluate the importance of the factors. You can right-click on the results provided, Make into Combined datatable, and then use Graph Builder to better visualize the results with a heatmap for example:

Victor_G_2-1795163471374.png

Again, no matter the type of model and estimation method, all the models seem to find the same root causes and impact of your factors on the response. If you are only interested about the mean response, then the model choice can be quite open. If you're also interested about the variance, loglinear variance model is in my opinion the best option to model both mean responsa and variance response.

Please find attached the completed file with two added scripts based on what has been shown in this answer.

 

Victor GUILLER

"It is not unusual for a well-designed experiment to analyze itself" (Box, Hunter and Hunter)

Recommended Articles