Some background (due to Sewall Wright’s method of path analysis) Given a generating model: y=β0+β1x1+β2x2+β3x3 where x3=x1x2; that is, it is an interaction variable. The total effect of x1 on y is β1+COV(x1,x2)VAR(x1)β2+COV(x1,x3)VAR(x1)β3. If x3 (the interaction) is missing, its component on the total efffect is added to the coefficient of x1.

Continue reading

This is a skeleton post Standardized variables (Wright’s rules) n <- 10^5 # z is the common cause of g1 and g2 z <- rnorm(n) # effects of z on g1 and g2 b1 <- 0.7 b2 <- 0.7 r12 <- b1*b2 g1 <- b1*z + sqrt(1-b1^2)*rnorm(n) g2 <- b2*z + sqrt(1-b2^2)*rnorm(n) var(g1) # E(VAR(g1)) = 1 ## [1] 1.001849 var(g2) # E(VAR(g2)) = 1 ## [1] 1.006102 cor(g1, g2) # E(COR(g1,g2)) = b1*b2 ## [1] 0.

Continue reading

Author's picture

R doodles. Some ecology. Some physiology. Much fake data.

Thoughts on R, statistical best practices, and teaching applied statistics to Biology majors.

Jeff Walker, Professor of Biological Sciences

University of Southern Maine, Portland, Maine, United States