嗨 - 我还是 jsl 脚本的新手,我正在尝试编写一个脚本,根据我的线性回归拟合创建和保存四个新列:
- 降低 95% 的平均置信区间
- 上 95% 的平均置信区间
- 降低 95% 的个人置信区间
- 上 95% 的个人置信区间
obj = Fit Model(
Y( :LOG_ECOLI_PEAR ),
Effects( :LOG_TURB_PEAR_FNU),
Personality( "Standard Least Squares" ),
Emphasis( "Effect Leverage" ),
Run(:LOG_ECOLI_PEAR
)) ;
obj << Prediction Formula;
谢谢!
你好@learning_JSL ,
这真的很容易。 您需要做的就是在现有的 JSL 中添加几行代码,然后就完成了。 当您使用它时,我强烈建议您使用“帮助”菜单下的“脚本索引”——它非常有用。
对于平均 CI,您将添加代码:obj << Mean Confidence Interval;对于单个 CI,您将添加 obj << Indiv Confidence Interval;。 默认值为 0.05 的 alpha(对应于您的 +/- 95%,但您可以指定所需的任何 alpha,例如:obj << Mean Confidence Interval(0.1) 将对应于 +/-90% CI。
下面是一些您可以使用 Diabetes.jmp 文件尝试的代码。
希望这可以帮助!,
DS
Names default to here(1);
dt=Open("$SAMPLE_DATA/Diabetes.jmp");
obj_fit = Fit Model(
Validation( :Validation ),
Y( :Y ),
Effects(
:Age, :Gender, :BMI, :BP, :Total Cholesterol, :LDL, :HDL, :TCH, :LTG,
:Glucose
),
Personality( "Standard Least Squares" ),
Emphasis( "Effect Leverage" ),
Run(
:Y << {Summary of Fit( 1 ), Analysis of Variance( 1 ),
Parameter Estimates( 1 ), Lack of Fit( 0 ), Scaled Estimates( 0 ),
Plot Actual by Predicted( 1 ), Plot Regression( 0 ),
Plot Residual by Predicted( 1 ), Plot Studentized Residuals( 0 ),
Plot Effect Leverage( 1 ), Plot Residual by Normal Quantiles( 0 ),
Box Cox Y Transformation( 0 )}
)
);
obj_fit << Prediction Formula;
obj_fit << Mean Confidence Interval;
obj_fit << Indiv Confidence Interval;