從樹結構獲取參數估計我有以下代碼(在JMP 14.2中)從邏輯回歸的樹結構中提取參數估計值。
fm = trend_count_dt << Fit Model(
Y( :Name( "<COLUMN name="">" ), :Total Cases ),
Effects( :Interval ),
Personality( Generalized Linear Model ),
GLM Distribution( Binomial ),
Link Function( Logit ),
Overdispersion Tests and Intervals( 0 ),
Name( "Firth Bias-adjusted Estimates" )(0),
Run, invisible
);
fmrep = fm << report;
parameter_estimates = fmrep[numbercolbox(14)] << get;
prob_chisq = fmrep[numbercolbox(17)] << get;
</COLUMN>
在用戶遇到錯誤之前,此操作一直可靠進行。對於其條件,參數估計值位於Number Col Box( 15 ),而不是( 14 )。有沒有一種簡單的方法來找出要使用的正確數字框?參數估計的99.99%的時間在(14)中。這是樹結構的一部分:

分析工具腳本編寫回复:從樹結構獲取參數估計這個應該工作,但返回的是字符串列表而不是對象(我一次獲得了支持票,需要檢入);
fm << XPath( "//NumberColBoxHeader[text()='Estimate']/following-sibling::NumberColBoxItem")
相反,您可以這樣做:
(fm << XPath( "//NumberColBox[NumberColBoxHeader[text()='Estimate']]"))[1][1::2]
這是我用來製作這些示例的完整腳本:
查看更多...Names default to here(1);
dt = Open( "$Sample_data/big class.jmp" );
fm = dt << Fit Model(
Y( :height, :weight ),
Effects( :sex ),
Personality( Generalized Linear Model ),
GLM Distribution( Binomial ),
Link Function( Logit ),
Overdispersion Tests and Intervals( 0 ),
Name( "Firth Bias-adjusted Estimates" )(0),
Run
);
//find nodes of interest here:
new window( "XML Script", << Script, fm << get xml);
//This SHOULD work but returns a string instead of the object (I had a support ticket in for it at one time, need to check into it);
fm << XPath( "//NumberColBoxHeader[text()='Estimate']/following-sibling::NumberColBoxItem")
//Instead you could do this:
(fm << XPath( "//NumberColBox[NumberColBoxHeader[text()='Estimate']]"))[1][1::2]
回复:從樹結構獲取參數估計指向大綱框後,我會做一個相對參考
parameter_estimates = fmrep["Parameter Estimates"][numbercolbox(1)] << get;
回复:從樹結構獲取參數估計謝謝吉姆-正是我所需要的!