# Would the Mantel-Haenszel test for linear trend be appropriate for this data/hypothesis?

I am testing whether or not there is an association between the parents education level and the pupils grades in the oral exam in social studies in the last year of danish primary school from the school year 2014/2015 to 2020/2021 (N = 184.641). In that regard I have a couple of questions which I will state first. I'll put my data, the source and further comments in the bottom.

I have two ordinal variables: the parents highest education level (from unknown, primary school, ..., higher education) and the pupils grade in Danish primary school categorised (1 (lowest), 2, .., 5). The data is for all danish pupils taking the oral exam in social studies class the last year of primary school. I have not done any tests yet to avoid p-hacking.

• Are the Mantel-Haenszel test appropriate for testing whether or not there is an association between the parents education level and the pupils grades (in this specific exam)?

• Is it a fair assumption that the row- and column scores are equal?

• If I instead used af chi-squared test for independence - i.e. treating the data as nominal, would there be any chance (theoretically) of getting a significant p-value on that test while the Mantel-Haenszel test gave a non-significant p-value? In other words are the Mantel-Haenszel better at detecting a relationsship (using the fact that the data is ordinal), but would never give a type I error while the chi-squared test on the same hypothesis and data wouldn't?

Picture of the data. The different colors are the different categories of grading.

The source is the danish ministry of educations online "datawarehouse" (https://uddannelsesstatistik.dk/Pages/Reports/1607.aspx).

The grades possible are -3 (1), 0 (1), 2 (2), 4 (3), 7 (4), 10 (5) and 12 (5) where (x) is the categories used. If the parents don't have the same level of education, it uses the parent with highest completed education. Primary school+ means primary school + one extra year etc.

If i choose to go with the Mantel-Haenszel test I think i'll use lazyWeave-package in R.

Data (.csv)
Parents education level/grade (grouped),1 (lowest),2,3,4,5 (highest)
Unknown,228,557,603,489,533
Primary school,546,1398,1571,1410,1245
Primary school+,444,1403,1755,1492,1325
Vocationel education,2700,10229,16499,18089,21933
High school,179,693,1062,1319,1840
Higher education,1182,6510,14751,23383,49263