Adam Smith 4 Posted May 8, 2019 Share Posted May 8, 2019 Hello, I would like to compare regression models of my data that use different weighting schemes. I have a data set ofxandyvalues, from which I have generated four different models: linear with weights 1/x, linear with weights 1/x2, quadratic with weight 1/x, and quadratic with weight 1/x2. It would be useful to visually represent these models as curves against a scatterplot of the data. However, when I try to add this, I'm met with some unexpected results. My initial instinct was to create a custom curve using the model coefficients data table. If, for instance, this table were Name Estimate StdError t.value p.value (Intercept) 2.637010E-004 0.000260 1.01391 0.31721 x 3.460683E-004 2.600832E-06 133.061 3.31484E-51I would expect the expression TERRAggregation_Real("output Link to comment Share on other sites More sharing options...
Gaia Paolini Posted May 9, 2019 Share Posted May 9, 2019 Thank you for submitting an example, that helps a lot. Your expression does not work because you cannot explicitly indexthe coefficients in an expression. Since you used Spotfire native regression:on each fit results page (e.g. OneOverX)at the top of the Model Summary text area (top left) there are a few symbols starting with a question mark. If you move across to the fourth from the left and hover over it, it says 'Predict from model'. If you click it, it will generate an extra column into your dummydata table, called 'Predicted'. This is the one you can plot. Go to Lines and Curves and select to Add a Line from column values. The table is dummydata, the x column is x and the y column is Predicted. If you add predicted columns from different models, they will be automatically named Predicted(2) etc. which you can then rename. Gaia Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now