Comment

Comment by elsherbini

It 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)
parent elsherbini 2 years ago

No comments yet

Be the first to share your thoughts.

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton