文档介绍:R语言线性回归案例数据分析可视化报告
在本实验中,我们将查看来自所有30个职业棒球大联盟球队的数据,并检查一个赛季的得分与其他球员统计数据之间的线性关系。我们的目标是通过图表和数字总结这些关系,以便找出哪个变量(如果有的话)可以帮助我们最tofitthelinearmodel().
m1<-lm(runs〜at_bats,data=mlb11)
Thefirstargumentinthefunctionlmisaformulathattakestheformy~.
.
【原创】R语言案例数据分析报告论文(附代码数据)
有问题到淘宝找“大数据部落”就可以了
summary(ml)##
##Call:
##lm(formula=runs〜at_bats,data=mlbl
1)
##
##Residuals:
##Min1QMedian3QMax
##———
##
##Coefficients:
##
Estimate
Std・Error
tvalue
r(>|t|)
##(Intercept)
—
—
**
##atbats
***
##———
##:0'***''**''
*''.'''1
##
【原创】R语言案例数据分析报告论文(附代码数据)
有问题到淘宝找“大数据部落”就可以了
##Residualstandarderror:
##MultipleR-squared:,AdjustedR-squared:
##F-statistic:,p-value:
Let',-"Coefficients"tableshownnextiskey;itsfirstcolumndisplaysthelinearmodel'sy-,wecanwritedowntheleastsquaresregressionlineforthelinearmodel:
y'=+*atbatsyA=-+*atbats
OnelastpieceofinformationwewilldiscussfromthesummaryoutputistheMultipleR-squared,ormoresimply,,%ofthevariabilityinrunsisexplainedbyat-bats.
,