レベル: 初心者
Mike Muhlada、JMP 開発テスター、SAS
オードリー・シュル、SAS JMP シニア開発テストマネージャー
この入門デモでは、数式エディタの仕組みを例を用いて説明し、よくあるエラーの調査と修正、そして数式作成のベストプラクティスと便利な「コツ」を習得します。詳細なウォークスルーでは、ドラッグアンドドロップ、キーボードショートカット、関数ボタンを使った数式の作成方法など、数式エディタのさまざまな側面を網羅します。例題を操作しながら、便利な関数について説明し、よくある間違いを発見して修正する方法などを紹介します。ベストプラクティスのトピックには、カスタム形式、データの「クリーンアップ」のための数式の使用、列の変換、文字列操作、JMP日付関数、中間列を使用したより複雑な数式の作成などがあります。特に、ユーザー定義関数、結果プレビュー、数式エラー/警告の「ライブ」検出、カスタマイズ可能な関数リストなど、JMP 14の新機能に重点を置きます。
// custom function
funcDef=function( {height, weight},
{Default Local},
(weight * 0.45) / (height * 0.025) ^ 2
);
description="This function calculates BMI, given a person's weight and height. Weight is presumed to be in pounds and Height is presumed to be in inches. The conversion to metric is done inside the function itself.";
// Examples can be multiple statements inside expr()
ex2=expr(
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
custom:BMI(:height[4], :weight[4])
);
parmHint1="Height in inches";
parmHint2="Weight in pounds";
//create function using variables
bmi_=New Custom Function("custom", "BMI", funcDef);
bmi_ << Description(description);
bmi_ << Prototype("custom:BMI(height,weight)");
bmi_ << Example("custom:BMI(72,225)");
// expr() Examples need to be passed inside NameExpr()
bmi_ << Example(NameExpr(ex2));
bmi_ << Parameter("Number", parmHint1);
bmi_ << Parameter("Number", parmHint2);
bmi_ << Formula Category( "Discovery" );
bmi_ << Scripting Index Category( "Frankfurt Functions" );
//add myNamespace:AddTen function to system
Add Custom Functions(bmi_);