时间序列分析(3)R语言-最基础的回归模型
2017-02-17 15:03
501 查看
rt<-read.table("exam0203.txt", head=TRUE); rt lm.sol<-lm(Weight~Height, data=rt) summary(lm.sol)
rt<-read.table("exam0203.txt", head=TRUE); rt Name Sex Age Height Weight 1 Alice F 13 56.5 84.0 2 Becka F 13 65.3 98.0 3 Gail F 14 64.3 90.0 4 Karen F 12 56.3 77.0 5 Kathy F 12 59.8 84.5 6 Mary F 15 66.5 112.0 7 Sandy F 11 51.3 50.5 8 Sharon F 15 62.5 112.5 9 Tammy F 14 62.8 102.5 10 Alfred M 14 69.0 112.5 11 Duke M 14 63.5 102.5 12 Guido M 15 67.0 133.0 13 James M 12 57.3 83.0 14 Jeffrey M 13 62.5 84.0 15 John M 12 59.0 99.5 16 Philip M 16 72.0 150.0 17 Robert M 12 64.8 128.0 18 Thomas M 11 57.5 85.0 19 William M 15 66.5 112.0
summary(lm.sol) Call: lm(formula = Weight ~ Height, data = rt) Residuals: Min 1Q Median 3Q Max -17.6807 -6.0642 0.5115 9.2846 18.3698 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) -143.0269 32.2746 -4.432 0.000366 *** Height 3.8990 0.5161 7.555 7.89e-07 *** --- Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 Residual standard error: 11.23 on 17 degrees of freedom Multiple R-squared: 0.7705, Adjusted R-squared: 0.757 F-statistic: 57.08 on 1 and 17 DF, p-value: 7.887e-07
#这是一个最基本的R语言回归模型的结果,其中,按照这些数据,可以得到身高和体重的模型:height=-143.02+3.899*weight,其中,相关系数R—squared,0.77,
p-Value:7.887e-7,可以认为是显著的。
相关文章推荐
- R语言时间序列分析之ARIMA模型预测
- 数据分析之《菜鸟侦探挑战数据分析》-6-r语言-时间序列-逻辑回归分析-自相关-日历图
- 时间序列分析-R语言-随机游走以及回归画图
- SPSS统计分析过程包括描述性统计、均值比较、一般线性模型、相关分析、回归分析、对数线性模型、聚类分析、数据简化、生存分析、时间序列分析、多重响应等几大类
- SPSS统计分析过程包括描述性统计、均值比较、一般线性模型、相关分析、回归分析、对数线性模型、聚类分析、数据简化、生存分析、时间序列分析、多重响应等几大类
- 金融时间序列分析:6. AR模型实例(R语言)
- R语言 时间序列分析之ARIMA模型预测
- 时间序列分析这件小事(二)--自回归
- R语言与数据分析之六:时间序列简单介绍
- R语言时间序列基础库zoo
- 时间序列分析及应用 R语言 读书笔记 02
- 时间序列分析中的ARMA,ARIMA模型整体综述
- 时间序列分析--ARIMA模型
- 时间序列分析这件小事(五)--MA模型
- 金融时间序列分析:1. 基础知识
- Python_Statsmodels包_时间序列分析_ARIMA模型
- R(2)时间序列分析及应用之TSA安装(R语言)
- R语言时间序列分析
- 时间序列分析:ts/mts基础数据类型
- 时间序列分析之 ARIMA 模型的JAVA实现