tabulate V045043 V043116, chi2
... then copy and paste it a bunch of times ...
tabulate V045043 V043116, chi2
tabulate V045043 V043116, chi2
tabulate V045043 V043116, chi2
... then go through with the arrow keys and delete key to increase the first variable by one another bunch of times -- say, 45 in all.
Or, you could let a spreadsheet (such as the free, open-source, completely Microsoft Excel-compatible OpenOffice Calc) do the work for you.
- Fire up a blank sheet and type your command in Column 1, your dependent variable in Column 2, your independent variable in Column 3, and ",chi2" in Column 4.
- Highlight the dependent variable you just typed and use the drag arrow (or whatever that thing's called) at the bottom right of the cell to generate a list of variables as long as you want that increases by one in each row.
- Finish by copying each of the other three elements, highlighting the empty cells where they're needed, and pasting.
- Highlight the whole thing and paste it into Stata's .do file editor, or your favorite text editor, and you're done. Stata doesn't care about the extra spaces.
Something similar would probably work to generate SPSS syntax, too, but I haven't tried it yet.