從樹結構中獲取參數估計我有以下代碼(在 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 )。有沒有一種簡單的方法可以找出要使用的正確數字 col 框?99.99% 的參數估計在 (14) 中。這是樹結構的一部分:

分析腳本回复:從樹結構中獲取參數估計謝謝吉姆——正是我需要的!
回复:從樹結構中獲取參數估計指向大綱框後我會做一個相對參考
parameter_estimates = fmrep["Parameter Estimates"][numbercolbox(1)] << get;
回复:從樹結構中獲取參數估計這個應該工作,但返回一個字符串列表而不是對象(我一次有一張支持票,需要檢查它);
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]