cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
JMP is taking Discovery online, April 16 and 18. Register today and join us for interactive sessions featuring popular presentation topics, networking, and discussions with the experts.
Choose Language Hide Translation Bar

How to do boxplot if both x and y are quantitative variable?

Hi

I am new in JMP, and it may be a simple question.  I would like to do a boxplot (instead of a scatter plot)  with id(y) vs Length(x) (both are quantitative variable).  Somehow I can only choose boxplot when X(length) is categorical variable, I can't find example in help when x is quantitative variable.

Thanks in advance for help.

Kelvin

1 ACCEPTED SOLUTION

Accepted Solutions
pmroz
Super User

Re: How to do boxplot if both x and y are quantitative bariable?

It's possible to do this in Graph Builder, in JMP 10 and JMP 11.  What version of JMP are you using?

I created a simple table with an X and Y column, where both were quantitative (=continuous) variables.  I was able to click on the boxplot icon to create a boxplot no problem.

Try copying and pasting the following code into a script window, and then hit CTRL-R to run it.

New Table( "Demo Box Plot",

    Add Rows( 13 ),

    New Script(

        "Graph Builder",

        Graph Builder(

            Show Control Panel( 0 ),

            Variables( X( :x ), Y( :Column 2 ) ),

            Elements(

                Box Plot(

                    X, Y, Legend( 3 ), Jitter( 1 ),

                   Outliers( 1 ), Box Style( "Outlier" )

                )

            )

        )

    ),

    New Column( "x", Numeric, Continuous,

        Format( "Best", 12 ),

        Set Values( [1, 1, 1, 2, 2, 2, 3, 3, 3, 3, 3, 4, 4] )

    ),

    New Column( "Column 2", Numeric,

        Continuous,   Format( "Best", 12 ),

        Set Values( [20.1, 20.3, 18, 15, 17, 34, 65, 45, 34, 54, 34, 12, 24] )

    )

);

View solution in original post

3 REPLIES 3
pmroz
Super User

Re: How to do boxplot if both x and y are quantitative bariable?

It's possible to do this in Graph Builder, in JMP 10 and JMP 11.  What version of JMP are you using?

I created a simple table with an X and Y column, where both were quantitative (=continuous) variables.  I was able to click on the boxplot icon to create a boxplot no problem.

Try copying and pasting the following code into a script window, and then hit CTRL-R to run it.

New Table( "Demo Box Plot",

    Add Rows( 13 ),

    New Script(

        "Graph Builder",

        Graph Builder(

            Show Control Panel( 0 ),

            Variables( X( :x ), Y( :Column 2 ) ),

            Elements(

                Box Plot(

                    X, Y, Legend( 3 ), Jitter( 1 ),

                   Outliers( 1 ), Box Style( "Outlier" )

                )

            )

        )

    ),

    New Column( "x", Numeric, Continuous,

        Format( "Best", 12 ),

        Set Values( [1, 1, 1, 2, 2, 2, 3, 3, 3, 3, 3, 4, 4] )

    ),

    New Column( "Column 2", Numeric,

        Continuous,   Format( "Best", 12 ),

        Set Values( [20.1, 20.3, 18, 15, 17, 34, 65, 45, 34, 54, 34, 12, 24] )

    )

);

Re: How to do boxplot if both x and y are quantitative bariable?

Yes, It works.  Thank you. 

Steven_Moore
Level VI

Re: How to do boxplot if both x and y are quantitative bariable?

Another way to do this:  Suppose your X values are no integers.  You can set up a nominal/categorical X variable by defining ranges of the X variable.  For example, let x = 0 - 5 be A, x = 5.1 - 10 = B, x = 10.1 -15 =15, etc.  Then you can do boxplots very nicely. 

Steve