简体   繁体   中英

How to compute partial correlation analysis, particularly spearman's pca?

I've tried to follow the instruction from the pcor.test manual (found here http://www.yilab.gatech.edu/pcor.html ), but the error came up

Non-numeric argument to mathematical function

What's wrong?

I initially used my own data which is imported from SPSS

pcor.test(a$Pexposed, a$w0, a$CAI, method = "spearman", na.rm = T)

but the output is like the following

Error in pcor.test(a$Pexposed, a$w0, a$CAI, method = "spearman", na.rm = T) : 
  unused argument(s) (method = "spearman", na.rm = T)

What's going on here? It seems that pcor.test is not for newbie user? Thanks for any help.

PS: Here's my data.

Pexposed=c(1:10)
w0=c(3:12)
CAI=c(2:11)
a=data.frame(Pexposed=Pexposed,w0=w0,CAI=CAI)

The error you get is because you gave a non-numerical vector to the function.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM