This may seem like a super odd question, but I wanna program in-time placebos for a command I've written. Here, we have a base year (say 1990), and we iteratively move the treatment back by however much the user wants.
Luckily though, I got the estimation covered. I'm more concerned about presentation. I want to keep users abreast of what time period is being used. At present, the
returns the result
Which is cool, but what if the user decided to go nuts and have 25 specific placebo-time interventions? then, we'd have
Which to me is unappealing. Here's what I want:
I want the resulting code to read something like
at the end of each iteration so that the resulting output doesn't take up lots of room. How might I do this?
This of course is a simplified example, but I imagine I'll be able to adapt it to my purposes.
Luckily though, I got the estimation covered. I'm more concerned about presentation. I want to keep users abreast of what time period is being used. At present, the
Code:
cls
loc interdate = 1990
loc times 2 3 4
foreach x of num 0 `times' {
loc npp = `interdate'-`x'
if `x' > 0 {
noi di "`npp' (`x' pre-periods)"
}
}
Code:
1988 (2 pre-periods) 1987 (3 pre-periods) 1986 (4 pre-periods)
Code:
cls
loc interdate = 1990
loc times 1/25
foreach x of num 0 `times' {
loc npp = `interdate'-`x'
if `x' > 0 {
noi di "`npp' (`x' pre-periods)"
}
}
I want the resulting code to read something like
Code:
1988 (2 pre-periods)...1987 (3 pre-periods)...1986 (4 pre-periods)
This of course is a simplified example, but I imagine I'll be able to adapt it to my purposes.

Comment