Arg
Arg using Try
Example 1
Summary: Adds value labels to a data table column, with error handling and retrieval of value labels.
Code:
dt = Open( "$SAMPLE_DATA/data_table.jmp", invisible );
Try(
Column( "Age" ) << Add Column Properties(
Value Labels( {12 = "Twelve", 13 = "Thirteen", 14 = "Fourteen", 15 = "Fifteen", 16 = "Sixteen", 17 = "Seventeen"} )
),
Show( "throw" )
);
valLabels = Arg( Column( "age" ) << Get Property( "Value Labels" ), 1 );
Code Explanation:
- Open data table.
- Try adding value labels.
- Catch and show error.
- Retrieve value labels.
Example 2
Summary: Adds List Check property to a column in JMP, with error handling and value retrieval.
Code:
dt = Open( "$SAMPLE_DATA/data_table.jmp", invisible );
Try( Column( "Age" ) << Add Column Properties( List Check( {17, 16, 15, 14, 13, 12} ) ), Show( "throw" ) );
valLabels = Arg( Column( "age" ) << Get Property( "List Check" ), 1 );
Code Explanation:
- Open data table;
- Attempt to add List Check property.
- If error, show "throw".
- Retrieve List Check values.
Example 3
Summary: Process of setting value labels for a column in a JMP data table, while also handling potential errors and retrieving the updated value labels.
Code:
dt = Open( "$SAMPLE_DATA/data_table.jmp", invisible );
Try( Column( "sex" ) << Set Property( "Value Labels", {"F" = "female", "M" = "male"} ), Show( "throw" ) );
valLabels = Arg( Column( "sex" ) << Get Property( "Value Labels" ), 1 );
Code Explanation:
- Open data table.
- Make table invisible.
- Try setting value labels.
- If error, show "throw".
- Retrieve value labels for "sex".
Example 4
Summary: Adds value labels to a column and retrieves existing value labels from another column in a JMP data table.
Code:
dt = Open( "$SAMPLE_DATA/data_table.jmp", invisible );
Try( Column( "xyz" ) << Add Column Properties( Value Labels( {"F" = "female", "M" = "male"} ) ) );
valLabels = Arg( Column( "sex" ) << Get Property( "Value Labels" ), 1 );
Code Explanation:
- Open data table;
- Attempt to add value labels to "xyz" column.
- Retrieve value labels from "sex" column.
Arg using Range
Summary: Configures a color gradient for the 'age' column in a JMP data table, utilizing multiple data updates and script retrieval.
Code:
dt = Open("data_table.jmp");
dt << BeginDataUpdate;
:age << set property( "Color Gradient", {"Blue to Gray to Red", Range( {12, 17, 13.975} )} );
dt << EndDataUpdate;
dt << BeginDataUpdate;
:age << Set Property( "Color Gradient", {"Blue to Gray to Red", Range( {12, 17, 13.975} )} );
dt << EndDataUpdate;
colScript = Char( Arg( :age << get script, 7 ) );
Code Explanation:
- Open data table.
- Start data update.
- Set age color gradient.
- End data update.
- Start data update again.
- Set age color gradient again.
- End data update again.
- Get age column script.
- Convert script to character.
- Store character script.
Arg using For
Summary: Generates a distribution analysis for continuous variables in a specified data table, utilizing the Distribution platform to select female students aged 15 and perform random statistical calculations.
Code:
dt = Open("data_table.jmp");
myRows = dt << get rows where( :age == 15 & :sex == "F" );
For( i = 1, i <= N Items( myRows ), i++,
:age[myRows[i]] = .
);
dt << New Column( "freq", formula( Random Integer( Row() ) ) );
sumStalst = {"N", "Mean", "Median", "Geometric Mean", "Min", "Max", "Range", "Sum", "% of Total", "Std Dev", "Variance", "Std Err",
"Interquartile Range"};
N Arg( sumStalst );
myStatistic = sumStalst[Random Integer( N Arg( sumStalst ) )];
lblLst = {"No Labels", "Label by Value", "Label by Percent of Total Values", "Label by Row"};
myLabel = lblLst[Random Integer( N Arg( lblLst ) )];
ErrBarlst = {"Auto", "None", "Range", "Interquartile Range", "Standard Error", "Standard Deviation", "Confidence Interval",
"Custom Interval", "Two-way Interval"};
myErrBar = ErrBarlst[Random Integer( N Arg( ErrBarlst ) )];
Code Explanation:
- Open data table;
- Select female students aged 15.
- Replace age values with missing for selected rows.
- Add new column "freq" with random integer formulas.
- Define summary statistics list.
- Randomly select a summary statistic.
- Define label options list.
- Randomly select a label option.
- Define error bar types list.
- Randomly select an error bar type.