data" />

多元统计模型

  1. 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
  2. 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
  3. 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。

姓名姚佳燕

评分

实验报告

课程名称:多元统计分析

专业班级:信息与计算科学082

学号:软件19号

指导教师:彭诚

完成日期:2011年 4 月12 日

第一次作业:

姚佳燕软件班19号

总分析:

每组的平均向量?"Sepal.Length" "Sepal.Width" "Petal.Length" "Petal.Width之间系数的线性判别式?

读取iris的数据:

> data(iris)

> attach(iris)

> names(iris)

"Sepal.Length" "Sepal.Width" "Petal.Length" "Petal.Width" "Species" Lda函数:

>library(MASS)

>iris.lda=lda(Species~Sepal.Length+Sepal.Width+Petal.Length+Peta l.Width)

> iris.lda

结果数据:

Call:

lda(Species ~ Sepal.Length + Sepal.Width + Petal.Length + Petal.Width) Prior probabilities of groups(之前的概率组):

setosa versicolor virginica

0.3333333 0.3333333 0.3333333

三品种的所占概率可认为是相同的。

Group means(每组的平均向量):

Sepal.Length Sepal.Width Petal.Length Petal.Width setosa 5.006 3.428 1.462 0.246 versicolor 5.936 2.770 4.260 1.326 virginica 6.588 2.974 5.552 2.026 Coefficients of linear discriminants(系数的线性判别式):

LD1 LD2

Sepal.Length 0.8293776 0.02410215

Sepal.Width 1.5344731 2.16452123

Petal.Length -2.2012117 -0.93192121

Petal.Width -2.8104603 2.83918785

Proportion of trace(比例的痕迹):

LD1 LD2

0.9912 0.0088

部分分析:(回归模型)

花萼的长宽之间的线性分析?

Sepal.Length关于Sepal.Width线性回归

> lm(Sepal.Length~Sepal.Width,data=iris)

结论:

Coefficients:

(Intercept) Sepal.Width

6.5262 -0.2234

函数lm拟合的一个线性回归模型:Sepal.Length=6.5262-0.2234Sepal.Width

花萼的长度和宽度之间的数据值位于两侧。> m00.lm=lm(Sepal.Length~Sepal.Width)

> par(mfrow=c(2,2))

> plot(m00.lm)

花瓣的长宽之间的线性分析?Petal.Length关于Petal.Width线性回归> lm(Petal.Length~Petal.Width,data=iris) 结论:

Coefficients:

(Intercept) Petal.Width

1.084

2.230

函数lm拟合的一个线性回归模型:Petal.Length=1.084+2.230Petal.Width

花瓣的长度和宽度之间呈明显的线性相关。> m01.lm=lm(Petal.Length~Petal.Width)

> par(mfrow=c(2,2))

> plot(m01.lm)

第二次作业:

模型准备

数据采集

The data are a random sample of records of resales of homes from Feb 15 to Apr 30, 1993 from the files maintained by the Albuquerque Board of Realtors. This type of data is collected by multiple listing agencies in many cities and is used by realtors as an information base.

Number of cases: 117

变量:

1.PRICE = Selling price ($hundreds)

2.SQFT = Square feet of living space

3.AGE = Age of home (years)

4.FEATS = Number out of 11 features (dishwasher, refrigerator, microwave, disposer, washer, intercom, skylight(s), compactor, dryer, handicap fit, cable TV access

5.CUST=Communications convenient(1) or not (0)

6.NE = Located in northeast sector of city (1) or not (0)

7.COR = Corner location (1) or not (0)

8.TAX = Annual taxes ($)

建立模型

分析:

PRICE与AGE的关系图:

相关文档
最新文档