World Statistics Day was yesterday, but we’re celebrating all week long! This celebration means acknowledging the impact statistics has on our world. Who is your favorite statistician? Share with us who they are and why they top your favorites list.
Choose Language Hide Translation Bar
Highlighted
shoffmeister
Level IV

Send a Message to All By-Groups in a Plattform

Hi JMPers,

in the multivariate plattform I would like to save all T2 values in my datatable via script.

Sadly I cannot figure out the command to save the T2-values in JSL. Further the report is using a by-variable so that I need to do something like "Hold CTRL pressed and left-click on T2-hotspot => Save T2" just in JSL.

Is that possible?

bc = Open("$SAMPLE_DATA/Big Class.jmp");

mlt = Multivariate(

  SendToByGroup( {:age == 12} ),

  Y( :height, :weight ),

  Estimation Method( "Row-wise" ),

  Matrix Format( "Square" ),

       Scatterplot Matrix(

            Density Ellipses( 1 ),

            Shaded Ellipses( 0 ),

            Ellipse Color( 3 )

       ),

  T²( 1 ),

  By( :age ),

  SendToByGroup(

  {:age == 12},

  SendToReport(

  Dispatch(

  {"Multivariate  age=12"},

  "Scatterplot Matrix",

  OutlineBox,

  {Close( 1 )}

  )

  )

  ),

  SendToByGroup(

  {:age == 13},

  SendToReport(

  Dispatch(

  {"Multivariate  age=13"},

  "Scatterplot Matrix",

  OutlineBox,

  {Close( 1 )}

  )

  )

  ),

  SendToByGroup(

  {:age == 14},

  SendToReport(

  Dispatch(

  {"Multivariate  age=14"},

  "Scatterplot Matrix",

  OutlineBox,

  {Close( 1 )}

  )

  )

  ),

  SendToByGroup(

  {:age == 15},

  SendToReport(

  Dispatch(

  {"Multivariate  age=15"},

  "Scatterplot Matrix",

  OutlineBox,

  {Close( 1 )}

  )

  )

  ),

  SendToByGroup(

  {:age == 16},

  SendToReport(

  Dispatch(

  {"Multivariate  age=16"},

  "Scatterplot Matrix",

  OutlineBox,

  {Close( 1 )}

  )

  )

  ),

  SendToByGroup(

  {:age == 17},

  SendToReport(

  Dispatch(

  {"Multivariate  age=17"},

  "Scatterplot Matrix",

  OutlineBox,

  {Close( 1 )}

  )

  )

  )

)

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
ian_jmp
Staff

Re: Send a Message to All By-Groups in a Plattform

Alternatively:

NamesDefaultToHere(1);

dt = Open("$SAMPLE_DATA/Body Measurements.jmp");

dt << NewColumn("By", Numeric, Nominal, Formula(RandomInteger(1, 2)));

mv = dt << Multivariate(

Y(

:Mass,

:Fore,

:Bicep,

:Chest,

:Neck,

:Shoulder

),

By(:By),

Estimation Method( "Row-wise" ),

Matrix Format( "Square" ),

Scatterplot Matrix(

Density Ellipses( 1 ),

Shaded Ellipses( 0 ),

Ellipse Color( 3 )

),

T Square(Save T Square)

);

View solution in original post

3 REPLIES 3
Highlighted
ms
Super User ms
Super User

Re: Send a Message to All By-Groups in a Plattform

It's a little tricky. Try this:

//Make a list of all T2 objects in the compound multivariate report "mlt"

T2_all = Repeat(

    i = 0;

    {i++ ; Report(mlt[i])[Outline Box("T" || "\!U00B2")] << get scriptable object};,

    N Items(mlt)

);

//Send the save message to all T2 in one move

T2_all << Save T Square;

Highlighted
ian_jmp
Staff

Re: Send a Message to All By-Groups in a Plattform

Alternatively:

NamesDefaultToHere(1);

dt = Open("$SAMPLE_DATA/Body Measurements.jmp");

dt << NewColumn("By", Numeric, Nominal, Formula(RandomInteger(1, 2)));

mv = dt << Multivariate(

Y(

:Mass,

:Fore,

:Bicep,

:Chest,

:Neck,

:Shoulder

),

By(:By),

Estimation Method( "Row-wise" ),

Matrix Format( "Square" ),

Scatterplot Matrix(

Density Ellipses( 1 ),

Shaded Ellipses( 0 ),

Ellipse Color( 3 )

),

T Square(Save T Square)

);

View solution in original post

Highlighted
ms
Super User ms
Super User

Re: Send a Message to All By-Groups in a Plattform

Of course! I started at the wrong end without looking back (although I had a feeling I was missing the obvious... )

Article Labels

    There are no labels assigned to this post.