程度:初學者
Mike Muhlada,SAS JMP 開發測試員
Audrey Shull,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_);