1

我在 Stata 中运行 Pearson 对多重插补数据的相关性:

mi query

local M=10
scalar corr=0

mi xeq 1/`M' : correlate v1 v2 ; scalar corr = corr + atanh(r(rho))
scalar corr = tanh(corr/`M')

di as txt "Correlation using Fisher's z over imputed data = " as res corr

上面的代码运行良好,只是它不会为每个系数生成 p 值。

有没有办法包含 p 值?

4

1 回答 1

1

pwcorr您可以通过使用以下选项获得具有 p 值的相关系数sig

. sysuse auto, clear
(1978 Automobile Data)

. pwcorr price mpg  length displacement headroom, sig

             |    price      mpg   length displa~t headroom
-------------+---------------------------------------------
       price |   1.0000 
             |
             |
         mpg |  -0.4686   1.0000 
             |   0.0000
             |
      length |   0.4318  -0.7958   1.0000 
             |   0.0001   0.0000
             |
displacement |   0.4949  -0.7056   0.8351   1.0000 
             |   0.0000   0.0000   0.0000
             |
    headroom |   0.1145  -0.4138   0.5163   0.4745   1.0000 
             |   0.3313   0.0002   0.0000   0.0000
             |

有关help pwcorr更多信息,请参阅。

于 2018-04-29T17:26:11.710 回答