Choose Language Hide Translation Bar
Highlighted
kk
kk
Level I

How do I connect two related responses for one factor with vertical lines? (Initial vs. Final)

I would like to connect two responses, initial and final, with a vertical line for each run. If possible, I would also love to display the difference value near the line. I have attached a picture of my graph and an example of what I would like (using powerpoint, I only did a subset of the data). 

 

 I would prefer an interactive explanation as I am not too familiar with JMP scripts. (but if I need a script that is ok too!)

Picture 66550.pngPicture 66550 2.png

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
gzmorgan0
Super User

Re: How do I connect two related responses for one factor with vertical lines? (Initial vs. Final)

It looks like you are using Graph Builder. Right click in the graph and:

  • Add Bars
  • Right click and select Bar > Bar Style > Stock

This will connect the Initial and Final values. Labeling is tricky. If you have a column of the differences, highlight the column and using the column menu, select Label.  Now if you hover over a point on the graph, you will see the difference. However, if you select all rows and select Label, the difference will be reported for both the initial and final values.   

The only way I know how to do what you described is with a script. Maybe there is a better solution.  Attached is table to simulate your data, with a script attached to generate ths graph.  If you do not need the labels, then you do not need the script.

image.png

View solution in original post

5 REPLIES 5
Highlighted
gzmorgan0
Super User

Re: How do I connect two related responses for one factor with vertical lines? (Initial vs. Final)

It looks like you are using Graph Builder. Right click in the graph and:

  • Add Bars
  • Right click and select Bar > Bar Style > Stock

This will connect the Initial and Final values. Labeling is tricky. If you have a column of the differences, highlight the column and using the column menu, select Label.  Now if you hover over a point on the graph, you will see the difference. However, if you select all rows and select Label, the difference will be reported for both the initial and final values.   

The only way I know how to do what you described is with a script. Maybe there is a better solution.  Attached is table to simulate your data, with a script attached to generate ths graph.  If you do not need the labels, then you do not need the script.

image.png

View solution in original post

Highlighted
kk
kk
Level I

Re: How do I connect two related responses for one factor with vertical lines? (Initial vs. Final)

Thank you!
Highlighted
kk
kk
Level I

Re: How do I connect two related responses for one factor with vertical lines? (Initial vs. Final)

One more thing: how can I add a character variable on the x-axis in addition to run number? I want to show the design pattern "000" "+--", etc. either directly above or below the run number. I have managed to duplicate the data to the right of the graph with the new x-variable but I cannot get them on the same graph/axis and still have run number go in order. I tried converting run number to a nominal and character variable, and value ordered the character variable but it still grouped experiments if they had the same pattern. 

 

 

Any help/suggestions would be greatly appreciated!

Highlighted
gzmorgan0
Super User

Re: How do I connect two related responses for one factor with vertical lines? (Initial vs. Final)

There are a few ways to do this, but probably the most descriptive axis is a concatenation of RunOrder and Pattern.

I added a column called pattern, and updated the table script. If the column named "RunOrder & Pattern" does not exist, then the script creates it.  The script includes a few more statements to accomodate the difference labels.

 

This should get you started. Another method is to make the pattern labels for Run Number. That JSL is not shown.

 

image.png

Highlighted
kk
kk
Level I

Re: How do I connect two related responses for one factor with vertical lines? (Initial vs. Final)

Thanks for the quick response! Yes this works, however the number difference displayed for each line is slightly off to the right. It looks like the script is the same in terms of "change" positioning so I am not sure why this rightward shift is occuring. 

Article Labels

    There are no labels assigned to this post.