正在加载图片...
cor(x,y) Life Exp Murder ##Popu1at1on-0.068051950.3436428 ##Income 0.34025534-0.2300776 #I11 iteracy-0.58847793 0.702975 #HS Grad 0.58221620-0.4879710 相关性检验函数 cor(state.x77) 样进 Population Income Illiteracy Life Exp Murder #Population 1.000000000.2082276 0.10762237-0.068051950.3436428 #Income 0.208227561.0000000-0.437075190.34025534-0.2300776 ##Illiteracy 0.10762237-0.43707521.00000000-0.588477930.7029752 ##Life Exp -0.068051950.3402553-0.588477931.00000000-0.7808458 ##Murder 0.34364275-0.23007760.70297520-0.780845751.0000000 #HS Grad -0.09848975 0.619932 -0.65718861 0.58221620-0.4879710 #Frost -0.332152450.2262822-0.671946970.26206801-0.5388834 #Area 0.02254384 0.36331540.07726113-0.107331940.2283902 #样 HS Grad Frost Area #Popu1 ation-0.09848975-0.33215250.02254384 ##Income 0.619932320.22628220.36331544 ##Illiteracy -0.65718861-0.67194700.07726113 ##Life Exp 0.582216200.2620680-0.10733194 ##Murder -0.48797102-0.53888340.22839021 ##HS Grad 1.00000000 0.3667797 0.33354187 ##Frost 0.366779701.00000000.05922910 Area 0.333541870.05922911.00000000 7cor.test *alternative是用来选择指定单侧检脸还是双侧检验 cor.test(state.x77[,3],state.x77[,5]) #Pearson's product-moment correlation 10 cor(x,y) ## Life Exp Murder ## Population -0.06805195 0.3436428 ## Income 0.34025534 -0.2300776 ## Illiteracy -0.58847793 0.7029752 ## HS Grad 0.58221620 -0.4879710 相关性检验函数 cor(state.x77) ## Population Income Illiteracy Life Exp Murder ## Population 1.00000000 0.2082276 0.10762237 -0.06805195 0.3436428 ## Income 0.20822756 1.0000000 -0.43707519 0.34025534 -0.2300776 ## Illiteracy 0.10762237 -0.4370752 1.00000000 -0.58847793 0.7029752 ## Life Exp -0.06805195 0.3402553 -0.58847793 1.00000000 -0.7808458 ## Murder 0.34364275 -0.2300776 0.70297520 -0.78084575 1.0000000 ## HS Grad -0.09848975 0.6199323 -0.65718861 0.58221620 -0.4879710 ## Frost -0.33215245 0.2262822 -0.67194697 0.26206801 -0.5388834 ## Area 0.02254384 0.3633154 0.07726113 -0.10733194 0.2283902 ## HS Grad Frost Area ## Population -0.09848975 -0.3321525 0.02254384 ## Income 0.61993232 0.2262822 0.36331544 ## Illiteracy -0.65718861 -0.6719470 0.07726113 ## Life Exp 0.58221620 0.2620680 -0.10733194 ## Murder -0.48797102 -0.5388834 0.22839021 ## HS Grad 1.00000000 0.3667797 0.33354187 ## Frost 0.36677970 1.0000000 0.05922910 ## Area 0.33354187 0.0592291 1.00000000 ?cor.test #alternative 是用来选择指定单侧检验还是双侧检验 # two.sided\greater\less cor.test(state.x77[,3],state.x77[,5]) ## ## Pearson's product-moment correlation ## 10
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有