Displaying 1 result from an estimated 1 matches for "d2xy2".
2004 Feb 19
1
Comparing two regression slopes
...; ssx1 <- var(df1$x)*(n-1) # sums of squares
> ssx2 <- var(df2$x)*(n-1)
> ssy1 <- var(df1$y)*(n-1)
> ssy2 <- var(df2$y)*(n-1)
> sxy1 <- cor(df1$x,df1$y)*(n-1)
> sxy2 <- cor(df2$x,df2$y)*(n-1)
> d2xy1 <- ssy1 - sxy1^2/ssx1 # unexplained
> d2xy2 <- ssy2 - sxy2^2/ssx2
> Fs <- db^2/((ssx1+ssx2)/(ssx1*ssx2)*(d2xy1+ d2xy2)/(2*n-4)) # F
statistic
> 1-pf(Fs,1,2*n-4)
[1] 0.8827102
slight differences, but can be MUCH larger with more data!
greetings,
joerg