How to determine the probability that two variables are related? I have a set of observations. Each observation has two variables:
# | VarA  | VarB
--|-------|-------
1 | True  | False
2 | False | False
3 | True  | True
4 | True  | False
...
(143,804 rows)

From this, I've got the following table:
          | VarB true | VarB false
VarA true |   729     |    1296
VarA false|   1753    |   140026

I want to know the chance that VarA and VarB are related, in the sense that their likelihood of occurring together is significantly higher than suggested by chance.
It's rare that an observation contains VarA or VarB (1.98% and 1.41% respectively); if the variables were randomly distributed I'd expect to see (0.0198*0.0141)*143804 = 40 co-occurrences, but instead I see 729.
My question is: for this and other observations, what test(s) can I run to check whether the results are independent or related? I've looked at chi-squared, but I can't work out whether it's valid.
 A: In general terms, if you have two random variables $A$ and $B$ and you have the joint probability distribution $P(A,B)$, then by marginalization you can find out if they are independent, i.e., $P(A,B) = P(A) P(B)$.
Marginalization means $P(A) = \sum_b P(A,b)$ and $P(B) =\sum_a P(a,B)$.
A: As requested in comments:
A chi-squared test is appropriate here (a large sample makes Fisher's exact test unnecessary) and not surprisingly will reject a null hypothesis that the two variables are independent, essentially for the reason you give (you have your percentages slightly wrong) 
Dividing all the values by about $10$ as you tried for your linked calculator 
will divide the resulting $\chi^2$ value by about $10$ reducing the significance of the result. In this case it is still highly significant, though in others it might change the conclusion
In R you could see something like 
> contingencytable = matrix(c(729, 1296, 1753, 140026), ncol=2)
> chisq.test(contingencytable)

        Pearson's Chi-squared test with Yates' continuity correction

data:  contingencytable
X-squared = 14204, df = 1, p-value < 2.2e-16

