cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Check out the JMP® Marketplace featured Capability Explorer add-in
Choose Language Hide Translation Bar
XiangLoh
Level I

Handling missing data when plotting variability charts with multiple Ys and BY groups

 

m1m2m3m4m5m6 m7m8DeviceFamily
12-2-1-32-1.50.5D1F1
2-2232-112D2F1
1.522.520.51-1-1.5D3F1
-11-1-1-0.510.5-1D4F1
2-31-21-2.50.5-1D5

F1

-3-0.5-11.5..-11D6F2
2.510.51.5..-0.52D7F2

I am going to use this table as an example. Assume that m1-m8 are some test parameters of some devices. In the actual table, the number of test parameters queried may be different. I want to plot variability charts using JSL for those parameters across Device for different Family.

In JSL, I did

myVC = Variability Chart(
			invisible,
			Y(Eval(parameterlist)),
			X(:Device),
			By(:Family)
		);

I have grouped the parameters m1-m8 as parameterlist. However due to the missing data, the code would result in error when it tries to plot the charts for F2.

 

Is there a way to handle the missing data? I want JMP to still plot the variability charts for F2 for the parameters that have data. (m1,m2,m3,m4,m7,m8 in this case). After that I want JMP to display the variability charts by family and save it as a html report.

F1 - m1

.

.

F1 - m8          (Order in which variability charts are shown in the report)

F2 - m1

.

F2 - m8

 

Note that the number of test paramters, number of device and the number of different families may vary depending on the queries. 

1 ACCEPTED SOLUTION

Accepted Solutions
gzmorgan0
Super User (Alumni)

Re: Handling missing data when plotting variability charts with multiple Ys and BY groups

XiangLoh,

You might want to review an earlier post

https://community.jmp.com/t5/Discussions/JSL-Generate-x-y-Plot-that-loops-through-columns-with-diffe...

 

The recommendations, I made there, I would apply to your data. Here are the steps/ pseudo code:

  • create parameterlist (already done)
  • Run, summarize( fgrp=By(:Family) ); the fgrp is the list of family values
  • nw = New Window("Tests",  vl = VListBox());

 

for( i=1, i<=nitems(fgrp), i++,
  fam = fgrp[i];
  for(j=1, j<=nitems(parameterlist), j++,
    param = parameterlist[j];
    idx = dt << get rows where(:Family == fam);
//    compute the number of non-missing values for column(param)[idx]
//    if that number is greater than 0 or some minimum you set then
      myVC = dt << Variability Chart( invisible, Y ( AsColumn(param) ) , X(:Device), By(:Family), where(:Family==fam) );
      get rid of the where where textbox and append to VL
); //end j
); //end i 

 

 

This method gives you a lot of flexibility.  You could save a different HTML for each family, or change the order and plot by variable then family.  Instead of the code for the 2 commented steps, you could use a Try()

 

Try(  myVC = dt << Variability Chart( invisible, Y ( AsColumn(param) ) , X(:Device), By(:Family), where(:Family==fam) );
//      get rid of the where where textbox and append to VL
,  //else do nothing 
   Show( "variable " || param || " for Family == " || fam || "has no valid data." )
 );   

 

 

It looks like a lot of work, but I have found that most scripters after they have done this once, and realize the amount of options this method offers, they use it often.

 

Good luck!

 

View solution in original post

2 REPLIES 2
gzmorgan0
Super User (Alumni)

Re: Handling missing data when plotting variability charts with multiple Ys and BY groups

XiangLoh,

You might want to review an earlier post

https://community.jmp.com/t5/Discussions/JSL-Generate-x-y-Plot-that-loops-through-columns-with-diffe...

 

The recommendations, I made there, I would apply to your data. Here are the steps/ pseudo code:

  • create parameterlist (already done)
  • Run, summarize( fgrp=By(:Family) ); the fgrp is the list of family values
  • nw = New Window("Tests",  vl = VListBox());

 

for( i=1, i<=nitems(fgrp), i++,
  fam = fgrp[i];
  for(j=1, j<=nitems(parameterlist), j++,
    param = parameterlist[j];
    idx = dt << get rows where(:Family == fam);
//    compute the number of non-missing values for column(param)[idx]
//    if that number is greater than 0 or some minimum you set then
      myVC = dt << Variability Chart( invisible, Y ( AsColumn(param) ) , X(:Device), By(:Family), where(:Family==fam) );
      get rid of the where where textbox and append to VL
); //end j
); //end i 

 

 

This method gives you a lot of flexibility.  You could save a different HTML for each family, or change the order and plot by variable then family.  Instead of the code for the 2 commented steps, you could use a Try()

 

Try(  myVC = dt << Variability Chart( invisible, Y ( AsColumn(param) ) , X(:Device), By(:Family), where(:Family==fam) );
//      get rid of the where where textbox and append to VL
,  //else do nothing 
   Show( "variable " || param || " for Family == " || fam || "has no valid data." )
 );   

 

 

It looks like a lot of work, but I have found that most scripters after they have done this once, and realize the amount of options this method offers, they use it often.

 

Good luck!

 

XiangLoh
Level I

Re: Handling missing data when plotting variability charts with multiple Ys and BY groups

Nice! Although I noticed that AsColumn in the variability chart doesnt seem to work for me. Changing it to Column (parameterlist[j]) works