In linear regression, regression weights of x1 on Y given x2 and x3 should be mathematically identical to the semipartial correlations between x1 and Y, given x2 and x3.
However, I do not obtain identical results, so apparently I'm doing something wrong in R. Data preparation: data<-read.csv("file.csv", head=T) data <- subset(data, select=c(age,s1,s2,s3,s5,s10,WSAS01)) data <- na.omit(data1) In the following example, I am interested in the regression coefficient/semi-partial correlation of s1(x) and WSAS01 (y). Regression: m1 <- lm(WSAS01 ~ s1+s2+s3+s5+s10+age, data=data) summary(m1) regression coefficient s1: 0.091 Semipartial Correlation: library(ppcor) spcor.test(data$s1,data$WSAS01,data[,c("age","s2","s3","s5","s10")]) semi-partial correlation s1 with WSAS01: 0.202 What am I doing wrong? Thank you T [[alternative HTML version deleted]] ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.