R语言实现一个回归
1个回答
展开全部
x<-c(1,2,3)
y<-c(3,4,5)
a<-data.frame(x,y)
a_lm<-lm(y~x,data=a)
> summary(a_lm)
Call:
lm(formula = y ~ x, data = a)
Residuals:
1 2 3
-7.020e-17 1.404e-16 -7.020e-17
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 2.000e+00 2.627e-16 7.614e+15 <2e-16 ***
x 1.000e+00 1.216e-16 8.224e+15 <2e-16 ***
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Residual standard error: 1.72e-16 on 1 degrees of freedom
Multiple R-squared: 1, Adjusted R-squared: 1
F-statistic: 6.764e+31 on 1 and 1 DF, p-value: < 2.2e-16
y<-c(3,4,5)
a<-data.frame(x,y)
a_lm<-lm(y~x,data=a)
> summary(a_lm)
Call:
lm(formula = y ~ x, data = a)
Residuals:
1 2 3
-7.020e-17 1.404e-16 -7.020e-17
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 2.000e+00 2.627e-16 7.614e+15 <2e-16 ***
x 1.000e+00 1.216e-16 8.224e+15 <2e-16 ***
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Residual standard error: 1.72e-16 on 1 degrees of freedom
Multiple R-squared: 1, Adjusted R-squared: 1
F-statistic: 6.764e+31 on 1 and 1 DF, p-value: < 2.2e-16
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询