I am trying to define a program that subsets data to loop over for some robustness analysis. For this, I try to add an option to choose a window option (e.g. 1yr or 2yr), but this causes the program to fail:
Unfortunately, I keep getting this:
I thought this implied that I erroneously included a space that is being interpreted as a cmd somewhere but haven't been able to figure it out, making me suspect I do not correctly understand how to use string inputs in a program.
Code:
capture program drop subset_data program subset_data, sortpreserve syntax, /// window(string) end subset_data, /// window(1yr)
Code:
. capture program drop subset_judgeiv_data . program subset_judgeiv_data, sortpreserve 1. syntax, /// > window(string) 2. end . . // subset to IV analysis dataset . subset_judgeiv_data, /// > window(1yr) . is not a valid command name r(199); end of do-file
I thought this implied that I erroneously included a space that is being interpreted as a cmd somewhere but haven't been able to figure it out, making me suspect I do not correctly understand how to use string inputs in a program.
Comment