zoukankan      html  css  js  c++  java
  • 相关性的显著性检验

    对计算好的相关系数进行显著性检验

    原假设:变量间不相关,即总体的相关系数为0。

    cor.test()对单个的 Pearson、Spearman 和 Kendall 相关系数进行检验。、

    格式:cor.test(x, y, alternative=, method=)

    x,y: 为要检验相关性的变量。

    alternative: 指定双侧检验或单侧检验。two.side, less 或 greater。

    method:method:指定相关系数的类型。pearson、spearman、kendall。

    (1)一次检验一种相关关系

    > cor.test(houseXQ[, c("house_total")],houseXQ[, c("house_area")] )

     

        Pearson's product-moment correlation

     

    data:  houseXQ[, c("house_total")] and houseXQ[, c("house_area")]

    t = 39.537, df = 187, p-value < 2.2e-16

    alternative hypothesis: true correlation is not equal to 0

    95 percent confidence interval:

     0.9274393 0.9585053

    sample estimates:

          cor

    0.9450675

    解释:总价与面积成正相关。

    (2)一次检验多种相关关系

    corr.test()

    检验结果的p值越小表明两个变量相关性越大,为0表示显著相关,<0.05表示相关性大,为1表示基本不相关。

    > selectedColumns<- c("house_total","house_avg","house_floor_curr","house_floor_total","house_area")

    > houseNum<-houseXQ[, selectedColumns]

    > corr.test(houseNum, use="complete")

  • 相关阅读:
    warmup_csaw_2016
    pwn-简单栈溢出
    吃土
    编程中的进制转换
    linux系统安全及应用——账号安全(基本安全措施)
    vmware vSphere虚拟网络之标准交换机(二)
    vmware vSphere虚拟网络(一)
    服务器虚拟化技术概述
    用shell脚本安装apache
    The server of Apache (二)——apache服务客户端验证
  • 原文地址:https://www.cnblogs.com/quietwalk/p/8301368.html
Copyright © 2011-2022 走看看