Which analysis should I use I am comparing data from two cohorts of patients that underwent a surgical procedure: Group 1 (2013-2015, n=157) and Group 2 (2016-2018, n=146). In both cohorts, I have patients that had survived and patients who had died, by their respective endpoint. For Group 1, 151 lived and 6 died; and for group 2, 134 lived and 12 died.
I need to analyze 2 things
1) whether the increase in deaths is statistically significant, and
2) whether a pre-existing risk category (coded as variables 1, 2, or 3 for each patient) had any effect.
For #1, I thought of doing a Chi-Square matrix, but what analysis could I use for #2?
Best,
 A: Before starting, I'd look into what 'respective endpoint' means. If that's 2 years for one group and half a year for the other, I don't see how any meaningful comparison can be made. 
First test. This can be run as a test of equality of two proportions. Results from Minitab statistical software are shown below. The P-value  0.109
is based on a normal approximation. The P-value  0.144 is from Fisher's
exact test, which is based on a hypergeometric distribution. Neither
P-value is sufficiently small to reject the null hypothesis, so there
is no significant difference between groups. 
Test and CI for Two Proportions 

Sample   X    N  Sample p
1        6  157  0.038217
2       12  146  0.082192

Difference = p (1) - p (2)
Estimate for difference:  -0.0439752
95% CI for difference:  (-0.0976797, 0.00972929)
Test for difference = 0 (vs ≠ 0):  Z = -1.60  P-Value = 0.109

Fisher’s exact test: P-Value = 0.144

[Before looking at the data, if you expected the latter death rate to be larger, you might test
against a one-sided alternative. (The wording of the question might suggest this approach.) In that case, both of the above P-values would be cut
approximately in half---still not small enough for statistical significance at the 5% level.]
Second test, accounting for risk. It is unclear how you might deal with the categorical variable
for three levels of pre-existing risk. 
(a) If you can justify putting all 303 subjects together into one group, then you might try a chi-squared test of independence to see if death rates differ by category.  The null hypothesis might be that 'risk' makes no difference.
(b) If you need to keep the two time groups separate, then you might consider looking at
a three-way contingency table with 2(times) by 3(risks) by 2(outcomes); that's 12 cells in the table. However, with 18 deaths spread somehow
among six cells, I don't see how you could run a valid chi-squared analysis.
A: You could use Chi-Square for #2, checking if the distribtion of deaths is equal to each variable is the same, but there are just a few deaths, so I am not sure if would be efficient. 
I think the same problem (few deaths) would affect linear regression.
