首页 > 编程知识 正文

线性规划的r方怎么算,样本决定系数公式

时间:2023-05-04 22:11:27 阅读:110072 作者:4056

显示决定系数

此示例说明如何显示r侧(判决因子)并调整r侧。 加载示例数据并定义响应和参数。

加载主机

y=hospital.blood pressure (:1 );

x=double(hospital ) :2:5 );

配合线性回归模型。

MDL=fitlm(x,y ) ) )。

mdl=

线性注册模型:

y ~ 1 x1 x2 x3 x4

Estimated Coefficients:

Estimate SE tStat pValue

_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ u

(Intercept ) 117.4 5.2451 22.383 1.1667e-39

x1 0.88162 2.9473 0.29913 0.76549

x2 0.08602 0.06731 1.278 0.20438

x3-0.0166850.055714-0.299470.76524

x4 9.884 1.0406 9.498 1.9546e-15

Number of observations: 100、Error degrees of freedom: 95

Root Mean Squared Error: 4.81

R-squared: 0.508、高级r-squared : 0.487

f-statistic vs.constant model :24.5,p-value=5.99e-14

r侧的值和调整r侧的值分别为0.508和0.487。 模型解释了响应变量约50%的变异。

使用拟合的LinearModel对象的特性访问r值并调整r值。

mdl.Rsquared.Ordinary

ans=0.5078

mdl.Rsquared.Adjusted

ans=0.4871

调整为r侧的值小于通常的r侧的值。

版权声明:该文观点仅代表作者本人。处理文章:请发送邮件至 三1五14八八95#扣扣.com 举报,一经查实,本站将立刻删除。