[线性回归][9.5]--标准化系数
  作用:当拟合时数据单位不一样时,得到的回归系数大小没有可比性(不能比较谁比较重要),这时就要计算标准话系数。

  这里就讲一下标准化系数的求法。
  [回归分析][9.5]--标准化系数
lm = LinearModelFit[data[[All, {2, 3, 1}]], {x1, x2}, {x1, x2}];
StandardCoeffient[data_List] := Block[{},
  canshu = lm["BestFitParameters"];
  y = StandardDeviation[data[[All, -1]]];
  stdcoe = {};
  For[i = 1, i <= Length[canshu] - 1, i++,
   temp = canshu[[i + 1]]*(StandardDeviation[data[[All, i]]]/y);
   stdcoe = AppendTo[stdcoe, temp];
   ];
  Grid[{Prepend[canshu[[2 ;;]], "未标准化系数"], Prepend[stdcoe, "标准化系数"]}, 
   Frame -> All]
  ]
定义了一个函数
[回归分析][9.5]--标准化系数
可以直接使用
标准化后的系数就可以直接比较了

以上,所有。
2016/11/22

 

相关文章:

  • 2021-04-23
  • 2021-04-25
  • 2021-12-09
  • 2021-12-22
  • 2021-07-04
  • 2021-05-26
  • 2022-12-23
  • 2021-08-04
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-10
  • 2021-11-09
  • 2021-06-19
  • 2021-08-28
相关资源
相似解决方案