This part connects two questions: are two variables independent, and how does one variable relate linearly to another? For categorical variables, such as whether a rating is downgraded and whether a firm defaults, a contingency table compares observed counts with counts that would be expected if the variables were independent. A chi-square statistic summarizes how far observed and expected frequencies differ.
For continuous variables, correlation and regression are common tools, but their assumptions matter. Failure to find a linear relationship is not proof that no relationship exists. Simple linear regression expresses a dependent variable as an intercept plus a slope times an independent variable, plus an error term. The slope estimates how much the conditional expected value of Y changes, on average, when X increases by one unit.