Hi @hardner ,
I better understand your dilemma now, thanks for taking some time to rephrase the problem you're facing.
In short, I believe you are right, that Fit Y by X is the only platform that allows for the nice overlay of the fits where you can widen the plot to see how the confidence bands change. And, it tends to make sense that the prediction formulas that are saved to the data table only go to the number of rows in that data table.
There might, however be a workaround that is pretty close to what you want. It's not perfect, but it's likely the closest you can get because of the limitations of the different platforms that you're needing to use (such as other model fitting platforms that are not Fit Y by X).
The idea I came up with was to create some "dummy" columns with dummy rows in the data table where the values are the expected mean -- that way it shouldn't mess up your confidence bands.
Here's the results using Graph Builder and the corresponding JSL code -- like what you showed.
Graph Builder(
Graph Spacing( 4 ),
Variables(
X( :hidden weight ),
Y( :Lower 95% Mean height ),
Y( :Upper 95% Mean height, Position( 1 ) ),
Y( :Pred Formula height, Position( 1 ) ),
Y( :hidden height, Position( 1 ) ),
Overlay( :sex )
),
Elements(
Area( X, Y( 1 ), Y( 2 ), Legend( 2 ), Area Style( "Range" ) ),
Line( X, Y( 3 ), Legend( 1 ) ),
Points( X, Y( 4 ), Legend( 1 ) )
),
SendToReport( Dispatch( {}, "X title", TextEditBox, {Set Text( "weight" )} ) )
);
Here are the steps I took to get there (and of course, this can all be coded in JSL, but would take some time for each case that you might be working with).
1. After running fit model as you did previously, save the formula columns of interest (Pred Mean, and +/-95% Mean CIs).
2. Create two dummy columns -- I chose :hidden height and :hidden weight for the names.
2a. Add four rows to the data table -- this is so you can have two points (low and high values) for both M and F sexes.
3. Make each of those columns into a formula
3a. For :hidden height, it looks like this:
3b. For :hidden weight it looks like this:
NOTE: I just chose 0 and 200 for values because they were easy (intercept is one) and the other I chose simply as a higher extreme, but these would be set to your needs.
4. Change the formulas for the prediction mean and +/-95% confidence intervals so that instead of using :weight to do the calculations, they're using :hidden weight for the calculations. An example for the prediction mean is below.
5. Go back and re-run your JSL code, but change the :height and :weight columns to the corresponding dummy columns so that it includes these extra four rows in the data table.
6. The last thing I did was change the last four rows from the default marker style to the "/" marker style so these mean value end points are less visible as the data itself. You do have the option of choosing Other... and use a different character. I just tried the double right pointing quotation marks (») from MS Word, and it worked just fine.
Notice that I also re-named the x-axis to "weight" so that "hidden weight" wasn't shown.
But, based on what you've described, I think this should handle what you're after. It's not the easiest or most elegant work around, but it does get the job done. I find it easier than trying to work with polygons in Graph Builder, for example.
Something to consider and think about.
Hope this helps,
DS