Hallo,
Ich passe ein Modell mithilfe einer Gruppierungsvariablen an und speichere die Vorhersage- und Intervallformeln in meiner Tabelle. Anschließend trage ich den ursprünglichen Y-Wert, den vorhergesagten Y-Wert und die untere/obere Kontrollgrenze (LCL/UCL) auf der Y-Achse ein und erstelle mithilfe der Wrap-Funktion ein Diagramm mit der Gruppierungsvariablen (siehe Codebeispiel unten).
Ich möchte die Transparenz meines Bereichs per Skript auf einen bestimmten Wert einstellen können. Mir ist bewusst, dass ich dies per Rechtsklick in der Legende ändern kann. Da es sich hier jedoch um ein Skript handelt, das Benutzereingaben verarbeitet, kann ich nicht die übliche Funktion „An Bericht senden und verteilen“ verwenden, bei der die Spalten statisch aufgerufen werden.
<BR />Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/Diamonds Data.jmp" );
mod = Fit Model(
Y( :Price ),
By( :Color ),
Effects( :Depth ),
Personality( "Standard Least Squares" ),
Emphasis( "Effect Screening" ),
Run(
:Price << {Summary of Fit( 0 ), Analysis of Variance( 0 ), Parameter Estimates( 1 ),
Sorted Estimates( 0 ), Plot Actual by Predicted( 1 ), Plot Regression( 0 ),
Plot Residual by Predicted( 1 )}
)
);
mod << prediction and interval formulas;
Graph Builder(
Size( 1163, 748 ),
Show Control Panel( 0 ),
Show Legend( 0 ),
Variables(
X( :Depth ),
Y( :Price ),
Y( :Pred Formula Price By Color, Position( 1 ) ),
Y( :Lower 95% Mean Price By Color, Position( 1 ) ),
Y( :Upper 95% Mean Price By Color, Position( 1 ) ),
Wrap( :Color ),
Overlay( :Color )
),
Elements(
Points( X, Y( 1 ), Legend( 7 ) ),
Line( X, Y( 2 ), Legend( 9 ) ),
Area( X, Y( 3 ), Y( 4 ), Legend( 10 ), Area Style( "Range" ), Transparency(0.25) )
)
);
Sie können nach PolySegs suchen und anschließend deren Transparenz festlegen.
Names Default To Here(1);
dt = Open("$SAMPLE_DATA/Diamonds Data.jmp");
mod = dt << Fit Model(
Y(:Price),
By(:Color),
Effects(:Depth),
Personality("Standard Least Squares"),
Emphasis("Effect Screening"),
Run(
:Price << {Summary of Fit(0), Analysis of Variance(0), Parameter Estimates(1),
Sorted Estimates(0), Plot Actual by Predicted(1), Plot Regression(0),
Plot Residual by Predicted(1)}
)
);
mod << prediction and interval formulas;
gb = dt << Graph Builder(
Size(1163, 748),
Show Control Panel(0),
Show Legend(0),
Variables(
X(:Depth),
Y(:Price),
Y(:Pred Formula Price By Color, Position(1)),
Y(:Lower 95% Mean Price By Color, Position(1)),
Y(:Upper 95% Mean Price By Color, Position(1)),
Wrap(:Color),
Overlay(:Color)
),
Elements(
Points(X, Y(1), Legend(7)),
Line(X, Y(2), Legend(9)),
Area(X, Y(3), Y(4), Legend(10), Area Style("Range"))
)
);
fbs = Report(gb) << XPath("//FrameBox");
For Each({fb}, fbs,
ps = fb << Find Seg(PolySeg(1));
If(!IsEmpty(ps),
ps << Transparency(0.25);
);
);