_대문 | 방명록 | 최근글 | 홈피소개 | 주인놈 |
FrontPage › 정준상관분석
|
|
[edit]
2 예제 #tmp <- textConnection( "tv 디자인 기능성 매력도 선호도 1 46 34 28 39 2 60 31 50 46 3 81 59 63 72 4 94 84 92 92 5 76 67 86 52 6 31 53 41 39 7 34 38 25 25 8 78 75 64 76 9 54 43 38 55 10 86 53 60 70 11 53 43 34 42 12 78 31 52 67 13 96 66 77 88 14 71 90 86 65 15 67 58 60 70 16 32 68 74 45 17 44 55 60 42 18 59 46 42 67 19 76 30 37 64 20 84 51 54 79") x <- read.table(tmp, header=TRUE) close.connection(tmp) #head(x) library("sqldf") d1 <- sqldf("select 디자인, 기능성 from x") d2 <- sqldf("select 매력도, 선호도 from x") rs1 <- cancor(d1, d2) rs1$cor > X <- with(x, -0.007865095 * (디자인-65.00) + -0.006951716 * (기능성-53.75)) > Y <- with(x, -0.007865095 * (매력도-56.15) + -0.006951716 * (선호도-59.75)) > cor.test(X,Y) Pearson's product-moment correlation data: X and Y t = 13.0087, df = 18, p-value = 1.362e-10 alternative hypothesis: true correlation is not equal to 0 95 percent confidence interval: 0.8772728 0.9806609 sample estimates: cor 0.9507151 > plot(X,Y) #install.packages("CCA") library("CCA") rs2 <- cc(d1, d2) plot(rs2$scores$xscores[,1], rs2$scores$yscores[,1]) [edit]
3 다른 방법 ##install.packages("yacca") library("yacca") rs3 <- cca(d1, d2) rs3 > rs3 Canonical Correlation Analysis Canonical Correlations: CV 1 CV 2 0.9558493 0.6976745 X Coefficients: CV 1 CV 2 디자인 -0.03428316 0.03920114 기능성 -0.03030183 -0.05234068 Y Coefficients: CV 1 CV 2 매력도 -0.02577813 -0.05651435 선호도 -0.03411328 0.05890991 Structural Correlations (Loadings) - X Vars: CV 1 CV 2 디자인 -0.8654311 0.5010280 기능성 -0.7527465 -0.6583105 Structural Correlations (Loadings) - Y Vars: CV 1 CV 2 매력도 -0.8653783 -0.5011192 선호도 -0.9098212 0.4150005 Aggregate Redundancy Coefficients (Total Variance Explained): X | Y: 0.7675629 Y | X: 0.823285 > plot(rs3) 해석을 해보면...
![]()
Canonical Correlations: CV 1 CV 2 0.9558493 0.6976745 ![]() Aggregate Redundancy Coefficients (Total Variance Explained): X | Y: 0.7675629 Y | X: 0.823285 ![]() Structural Correlations (Loadings) - X Vars: CV 1 CV 2 디자인 -0.8654311 0.5010280 기능성 -0.7527465 -0.6583105 Structural Correlations (Loadings) - Y Vars: CV 1 CV 2 매력도 -0.8653783 -0.5011192 선호도 -0.9098212 0.4150005
![]() X Coefficients: CV 1 CV 2 디자인 -0.03428316 0.03920114 기능성 -0.03030183 -0.05234068 Y Coefficients: CV 1 CV 2 매력도 -0.02577813 -0.05651435 선호도 -0.03411328 0.05890991 정준상관계수
> X <- with(x, -0.03428316 * 디자인 + -0.03030183 * 기능성) > Y <- with(x, -0.02577813 * 매력도 + -0.03411328 * 선호도) > cor.test(X,Y) Pearson's product-moment correlation data: X and Y t = 13.8003, df = 18, p-value = 5.156e-11 alternative hypothesis: true correlation is not equal to 0 95 percent confidence interval: 0.8896248 0.9827032 sample estimates: cor 0.9558493 어느 정준상관계수까지 쓸모있나? (Bartlett's test)
> F.test.cca(rs3) F Test for Canonical Correlations (Rao's F Approximation) Corr F Num df Den df Pr(>F) CV 1 0.95585 30.00045 4.00000 32 2.029e-10 *** CV 2 0.69767 16.12224 1.00000 17 0.0008971 *** --- Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
|
당신이 가야 할 길이 당신의 눈앞에 있거든 망설이지 말라. 당신이 가야 할 길이 분명하면 기꺼이 확고한 의지로 그 길을 가라. 혹시 당신이 가야 할 길이 보이지 않는다면 멈추어 서서 가장 훌륭한 충고자들과 상의하라. 만일 당신이 가는 길에 어떤 장애물이 나타나면 정의가 가리키는 길을 따라 당신이 갈 수 있는 곳까지 조심히 나아가라. (아우렐리우스) |