search for: ssx2

Displaying 2 results from an estimated 2 matches for "ssx2".

Did you mean: sse2
2004 Feb 19
1
Comparing two regression slopes
...gt; db <- (s2[2,1]-s1[2,1]) > sd <- sqrt(s2[2,2]^2+s1[2,2]^2) > df <- (fit1$df.residual+fit2$df.residual) > td <- db/sd > 2*pt(-abs(td), df) [1] 0.8757552 Sokal & Rholf > n <- length(df1$x) > 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)...
2009 Feb 12
0
Comparing slopes in two linear models
...lm( log(df2$varCDI)~log(df2$CDI) ) s1 <- summary(fit1)$coefficients s2 <- summary(fit2)$coefficients db <- (s1[2,1]-s2[2,1]) #### TEST DEGREES OF FREEDOM n1 <- fit1$df.residual n2 <- fit2$df.residual n <- n1 + n2 ### Pooled Variance #### ssx1 <- var(df1$CDI) * (n1+1) ssx2 <- var(df2$CDI) * (n2+1) RSS1 <- anova(fit1)[2,2] RSS2 <- anova(fit2)[2,2] sspvm <- ( RSS1 + RSS2 ) / n sd1_2 <- sqrt( sspvm/ssx1 + sspvm/ssx2 ) td <- db/sd1_2 2*pt(-abs(td), n) } Zar(dP, dHT) [1] 0.4040566 Is there anything wrong with the function I wrote? Assuming that...