Hi,
I have a project that I will automate annually.
I'm trying to find an efficient way to store last year (the data year) in a local macro. I have a solution but it seems inelegant. Here is my code:
local year =yofd(date("$S_DATE", "DMY"))
local year = `year'-1
di "`year'"
Is there a better way to do this? is there an $S_YEAR or something similar?
Thanks in advance!
Related Posts with Extracting last year from $S_DATE
Multiple imputation convergence not achievedHi all, I'm trying to perform chained multiple imputations but get an error message about convergen…
mediation effect and endogenousDear sir or madam: But I have some question about the mediation effect and endogenous: Is there a tr…
Inverse Probability Weighing for Multiple TreatmentsHi all, I am trying to compute inverse probability weight for multiple treatments. But I am struggl…
What is the c.operator in reg and set emptycells ?Today when I run this regression Code: did2s l_homicide [aweight=popwt], first_stage(i.sid i.year)…
How to run the Stata code for specific number of observations in panel data?Because when running the code below, it seems that Stata takes a long time to run it, so I want to t…
Subscribe to:
Post Comments (Atom)
0 Response to Extracting last year from $S_DATE
Post a Comment