3 ms·
Is there a simple R example for Rule 4?
by raymondh 2y ago
Is there a simple R example for Rule 4?
- elsherbini 2y agoIt is sort of tautological: # variable A has three causes: C1,C2,C3 C1 <- rnorm(100) C2 <- rnorm(100) C3 <- rnorm(100) A <- ifelse(C1 + C2 + C3 > 1, 1, 0) cor(A, C1) cor(A, C2) cor(A, C3) # If we set the values of A ourselves... A <- sample(c(1,0), 100, replace=TRUE) # then A no longer has correlation with its natural causes cor(A, C1) cor(A, C2) cor(A, C3)