Displaying 2 results from an estimated 2 matches for "pcor3".
Did you mean:
pcor
2007 May 18
1
partial correlation significance
Hi,
among the many (5) methods that I found in the list to do partial
correlation in the following two that I had a look I am getting different
t-values. Does anyone have any clues on why is that? The source code is
below. Thanks.
pcor3 <- function (x, test = T, p = 0.05) {
nvar <- ncol(x)
ndata <- nrow(x)
conc <- solve(cor(x))
resid.sd <- 1/sqrt(diag(conc))
pcc <- -sweep(sweep(conc, 1, resid.sd, "*"), 2, resid.sd, "*")
#colnames(pcc) <- rownames(pcc) <- colnames(x)
if (tes...
2007 May 22
0
partial correlation function
Hi,
after reading the archives I found some methods... adopted and
modified one of them to the following. I think it is correct after
checking and comparing the results with other software... but if
possible someone could have a look and spot any mistakes I would be
grateful. Thanks
pcor3 <- function (x, test = T, p = 0.05, alternative="two.sided") {
nvar <- ncol(x)
ndata <- nrow(x)
conc <- solve(cor(x))
resid.sd <- 1/sqrt(diag(conc))
pcc <- -sweep(sweep(conc, 1, resid.sd, "*"), 2, resid.sd, "*")
#colnames(pcc) <- rownam...