从树结构获取参数估计我有以下代码(在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;
回复:从树结构获取参数估计谢谢吉姆-正是我所需要的!