c1=c[1:3,1:3]>colMeans(c1)X1X.2X0NANANA>c=read.csv(file=file.choose(),head=T)>c1=c[1:3,1:3]>c=read.csv(file=file.choose(),head=T)>c1=c[1:" />
文档库 最新最全的文档下载
当前位置:文档库 › 验证相关系数矩阵与标准化后协方差矩阵相等

验证相关系数矩阵与标准化后协方差矩阵相等

c=read.csv(file=file.choose(),head=T)
> colmeans(c)
错误: 没有"colmeans"这个函数
> c1=c[1:3,1:3]
> colMeans(c1)
X1 X.2 X0
NA NA NA
> c=read.csv(file=file.choose(),head=T)
> c1=c[1:3,1:3]
> c=read.csv(file=file.choose(),head=T)
> c1=c[1:3,1:3]
> colMeans(c1)
x1 x2 x3
-0.3333333 1.0000000 0.6666667
> cov(c1)
x1 x2 x3
x1 2.3333333 -5.5 0.3333333
x2 -5.5000000 13.0 -1.0000000
x3 0.3333333 -1.0 1.3333333
> cor(c1)
x1 x2 x3
x1 1.0000000 -0.9986254 0.1889822
x2 -0.9986254 1.0000000 -0.2401922
x3 0.1889822 -0.2401922 1.0000000
> eigen(c1)
$values
[1] 5.8284271 2.0000000 0.1715729

$vectors
[,1] [,2] [,3]
[1,] -0.3826834 0 0.9238795
[2,] 0.9238795 0 0.3826834
[3,] 0.0000000 1 0.0000000

> c=read.csv(file=file.choose(),head=T)
> c1=c[1:3,1:3]
> scale(c1)
x1 x2 x3
1 0.7657533 -0.9215278 0.07900694
2 -1.1313527 -0.1418054 -1.03715994
3 0.3655994 1.0633333 0.95815300
attr(,"scaled:center")
x1 x2 x3
0.09738030 0.03099798 0.11949950
attr(,"scaled:scale")
x1 x2 x3
0.07460766 0.01956018 0.06527684
> c=read.csv(file=file.choose(),head=T)
> c1=c[1:3,1:3]
>
> colMeans(c1)
x1 x2 x3
4 5 6
> cov(c1)
x1 x2 x3
x1 9 9 9
x2 9 9 9
x3 9 9 9
> cor(c1)
x1 x2 x3
x1 1 1 1
x2 1 1 1
x3 1 1 1
> c=read.csv(file=file.choose(),head=T)
> c1=c[1:3,1:3]
> scale(c1)
x1 x2 x3
1 -1 -1 -1
2 0 0 0
3 1 1 1
attr(,"scaled:center")
x1 x2 x3
4 5 6
attr(,"scaled:scale")
x1 x2 x3
3 3 3
> c2=scale(c1)
> colMeans(c2)
x1 x2 x3
0 0 0
> cov(c2)
x1 x2 x3
x1 1 1 1
x2 1 1 1
x3 1 1 1
> cor(c2)
x1 x2 x3
x1 1 1 1
x2 1 1 1
x3 1 1 1
> c=read.csv(file=file.choose(),head=T)
> c1=c[1:3,1:3]
> )
错误: 意外的')'在")"里
> colMeans(c1)
x1 x2 x3
8.666667 5.666667 5.333333
> cov(c1)
x1 x2 x3
x1 32.333333 -16.666667 -7.333333
x2 -16.666667 10.333333 7.666667
x3 -7.333333 7.666667 10.333333
> cor(c1)
x1 x2 x3
x1 1.0000000 -0.9118078 -0.4011954
x2 -0.9118078 1.0000000 0.7419355
x3 -0.4011954 0.7419355 1.0000000
> scale(c1)
x1 x2 x3
1 1.1137997 -1.1406469 -0.7258662
2 -0.8206945 0.4147807 -0.4147807
3 -0.2931052 0.7258662 1.1406469
attr(,"scaled:center")
x1 x2 x3
8.666667 5.666667 5.333333
attr(,"scaled:scale")
x1 x2 x3
5.686241 3.214550 3.214550
> c2=scale(c1)
> colMeans(c2)
x1 x2 x3
9.251859e-17 -1.480297e-16 1.480297e-16
> cov(c2)
x1 x2 x3
x1 1.0000000 -0.9118078 -0.4011954
x2 -0.9118078 1.0000000 0.7419355
x3 -0.4011954 0.7419355 1.0000000
> cor(c2)
x1 x2

x3
x1 1.0000000 -0.9118078 -0.4011954
x2 -0.9118078 1.0000000 0.7419355
x3 -0.4011954 0.7419355 1.0000000
>


c=read.csv(file=file.choose(),head=T)
> colmeans(c)
错误: 没有"colmeans"这个函数
> c1=c[1:3,1:3]
> colMeans(c1)
X1 X.2 X0
NA NA NA
> c=read.csv(file=file.choose(),head=T)
> c1=c[1:3,1:3]
> c=read.csv(file=file.choose(),head=T)
> c1=c[1:3,1:3]
> colMeans(c1)
x1 x2 x3
-0.3333333 1.0000000 0.6666667
> cov(c1)
x1 x2 x3
x1 2.3333333 -5.5 0.3333333
x2 -5.5000000 13.0 -1.0000000
x3 0.3333333 -1.0 1.3333333
> cor(c1)
x1 x2 x3
x1 1.0000000 -0.9986254 0.1889822
x2 -0.9986254 1.0000000 -0.2401922
x3 0.1889822 -0.2401922 1.0000000
> eigen(c1)
$values
[1] 5.8284271 2.0000000 0.1715729

$vectors
[,1] [,2] [,3]
[1,] -0.3826834 0 0.9238795
[2,] 0.9238795 0 0.3826834
[3,] 0.0000000 1 0.0000000

> c=read.csv(file=file.choose(),head=T)
> c1=c[1:3,1:3]
> scale(c1)
x1 x2 x3
1 0.7657533 -0.9215278 0.07900694
2 -1.1313527 -0.1418054 -1.03715994
3 0.3655994 1.0633333 0.95815300
attr(,"scaled:center")
x1 x2 x3
0.09738030 0.03099798 0.11949950
attr(,"scaled:scale")
x1 x2 x3
0.07460766 0.01956018 0.06527684
> c=read.csv(file=file.choose(),head=T)
> c1=c[1:3,1:3]
>
> colMeans(c1)
x1 x2 x3
4 5 6
> cov(c1)
x1 x2 x3
x1 9 9 9
x2 9 9 9
x3 9 9 9
> cor(c1)
x1 x2 x3
x1 1 1 1
x2 1 1 1
x3 1 1 1
> c=read.csv(file=file.choose(),head=T)
> c1=c[1:3,1:3]
> scale(c1)
x1 x2 x3
1 -1 -1 -1
2 0 0 0
3 1 1 1
attr(,"scaled:center")
x1 x2 x3
4 5 6
attr(,"scaled:scale")
x1 x2 x3
3 3 3
> c2=scale(c1)
> colMeans(c2)
x1 x2 x3
0 0 0
> cov(c2)
x1 x2 x3
x1 1 1 1
x2 1 1 1
x3 1 1 1
> cor(c2)
x1 x2 x3
x1 1 1 1
x2 1 1 1
x3 1 1 1
> c=read.csv(file=file.choose(),head=T)
> c1=c[1:3,1:3]
> )
错误: 意外的')'在")"里
> colMeans(c1)
x1 x2 x3
8.666667 5.666667 5.333333
> cov(c1)
x1 x2 x3
x1 32.333333 -16.666667 -7.333333
x2 -16.666667 10.333333 7.666667
x3 -7.333333 7.666667 10.333333
> cor(c1)
x1 x2 x3
x1 1.0000000 -0.9118078 -0.4011954
x2 -0.9118078 1.0000000 0.7419355
x3 -0.4011954 0.7419355 1.0000000
> scale(c1)
x1 x2 x3
1 1.1137997 -1.1406469 -0.7258662
2 -0.8206945 0.4147807 -0.4147807
3 -0.2931052 0.7258662 1.1406469
attr(,"scaled:center")
x1 x2 x3
8.666667 5.666667 5.333333
attr(,"scaled:scale")
x1 x2 x3
5.686241 3.214550 3.214550
> c2=scale(c1)
> colMeans(c2)
x1 x2 x3
9.251859e-17 -1.480297e-16 1.480297e-16
> cov(c2)
x1 x2 x3
x1 1.0000000 -0.9118078

-0.4011954
x2 -0.9118078 1.0000000 0.7419355
x3 -0.4011954 0.7419355 1.0000000
> cor(c2)
x1 x2 x3
x1 1.0000000 -0.9118078 -0.4011954
x2 -0.9118078 1.0000000 0.7419355
x3 -0.4011954 0.7419355 1.0000000
>


相关文档
相关文档 最新文档