I'm working with a very large dataset over several years (3-4M for each year, 5 years of data). I'm looking to generate a report prior to merging all datasets together to check against a control table. I've developed a set of code for the report, but I'm looking for a way to auto-populate the year in each table title. I"m using the dtable command, see example here.
What I'm looking for is some way to substitute "2022" in the above code so I can generate the correct year that corresponds with each year's data, such that 2018 is plugged in for 2018 data, without me having to go in and manually change all the tables each time I run the report do file. Any ideas or thoughts? Or do I just need to make the manual change? Or maybe there's another approach I'm not considering, like an automated header or something?
Code:
dtable i.( edu sexr married raceth age16) , title("2022 Demographics") note(Results reported as N(%) and percents) putdocx collect
Comment