- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Graph Builder - small and big subset
I have some (outlier) data points and want to compare the individual values with 2 reference sets.
ideal: points for the small set and violin for the references.
Can I specify this in Graph Builder?
workaround 1: fill the x axis twice
workaround 2: ... with a second question
use points (for everything) - and packed jitter to get a feeling for the distribution.
But graph Builder is a little lazy when calculating packed jitter positions for larger data sets.
Can i change this behavior?
generatePlot=Function ({nRows},{Default Local},
dt = New Table();
dt << add rows( nRows );
dt:Column1 << set name( "group" ) << Set Modeling Type( "Nominal" ) <<
Formula( tmp=Random uniform( 2 );If(tmp<0.001,0,tmp < 0.5, 1,2) );
dt << New Column( "select", Formula( Random Uniform( ) ) );
dt << New Column( "rnd", Formula( Random Normal( ) ) );
Graph Builder(
Size( 523, 411 ),
Show Control Panel( 0 ),
Graph Spacing( 4 ),
Variables(
X( :group ),
Y( :rnd ),
Overlay( :group )
),
Elements( Position( 1, 1 ), Points( X, Y, Legend( 17 ), Jitter( "Packed" ) ) )
));
generatePlot(100000); // how it should look like
generatePlot(500000); // larger data set
generatePlot(1000000); // even larger data set
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Graph Builder - small and big subset
You could build that in one chart by creating separate x or y columns for each type of graph you want, and then limit which variables are used in each feature.
Code to reproduce:
Names default to here(1);
generatePlot=Function ({nRows},{Default Local},
dt = New Table();
dt << add rows( nRows );
dt:Column1 << set name( "group" ) << Set Modeling Type( "Nominal" ) <<
Formula( tmp=Random uniform( 2 );If(tmp<0.001,0,tmp < 0.5, 1,2) );
dt << New Column( "select", Formula( Random Uniform( ) ) );
dt << New Column( "rnd", Formula( Random Normal( ) ) );
dt << New Column("Reference", Numeric, "Continuous", Format("Best", 12), Formula(If(:group == 0, Empty(), :rnd)));
dt << New Column("Value", Numeric, "Continuous", Format("Best", 12), Formula(If(:group == 0, :rnd)));
dt << Graph Builder(
Size( 840, 589 ),
Show Control Panel( 0 ),
Variables( X( :group ), Y( :Reference ), Y( :Value, Position( 1 ) ) ),
Elements(
Points( X, Y( 2 ), Legend( 19 ) ),
Box Plot( X, Y( 2 ), Legend( 22 ) ),
Contour( X, Y( 1 ), Legend( 23 ) )
),
SendToReport(
Dispatch( {}, "graph title", TextEditBox, {Set Text( "rnd vs. group" )} ),
Dispatch( {}, "Y title", TextEditBox, {Set Text( "rnd" )} )
)
)
);
//All three should look the same
generatePlot(100000);
generatePlot(500000);
generatePlot(1000000);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Graph Builder - small and big subset
You could build that in one chart by creating separate x or y columns for each type of graph you want, and then limit which variables are used in each feature.
Code to reproduce:
Names default to here(1);
generatePlot=Function ({nRows},{Default Local},
dt = New Table();
dt << add rows( nRows );
dt:Column1 << set name( "group" ) << Set Modeling Type( "Nominal" ) <<
Formula( tmp=Random uniform( 2 );If(tmp<0.001,0,tmp < 0.5, 1,2) );
dt << New Column( "select", Formula( Random Uniform( ) ) );
dt << New Column( "rnd", Formula( Random Normal( ) ) );
dt << New Column("Reference", Numeric, "Continuous", Format("Best", 12), Formula(If(:group == 0, Empty(), :rnd)));
dt << New Column("Value", Numeric, "Continuous", Format("Best", 12), Formula(If(:group == 0, :rnd)));
dt << Graph Builder(
Size( 840, 589 ),
Show Control Panel( 0 ),
Variables( X( :group ), Y( :Reference ), Y( :Value, Position( 1 ) ) ),
Elements(
Points( X, Y( 2 ), Legend( 19 ) ),
Box Plot( X, Y( 2 ), Legend( 22 ) ),
Contour( X, Y( 1 ), Legend( 23 ) )
),
SendToReport(
Dispatch( {}, "graph title", TextEditBox, {Set Text( "rnd vs. group" )} ),
Dispatch( {}, "Y title", TextEditBox, {Set Text( "rnd" )} )
)
)
);
//All three should look the same
generatePlot(100000);
generatePlot(500000);
generatePlot(1000000);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Graph Builder - small and big subset
nice