从树结构中获取参数估计我有以下代码(在 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]