You would basically have take two randomized groups both starting with 200k and have one invest it into stocks and another into a 4 year college degree and compare net worth a few decades later.
Even then you would only be answering the question of whether that decision was optimal for that point in time.
An artificial experiment would be nice, but the cost, ethics, etc. make it not too practical. The best research uses natural experiments, like when some external factor changes the number of university places available, so that people who would have gone to college in the 2017 cohort don't in 2018 (or vice versa). That gives you the answer for the marginal applicant (i.e., the applicant who was just on the edge of qualifying), though, not the average.