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
Xtabond2 Model SpecificationN: 2500 T: 3 For my purposes: - Endogenous: x1, x2, x3 - Predetermined: x4 - Exogenous: x5 x6 x7 x8…
Predict after fixed effect regressionDear Statlist, I am performing a simple Fixed Effects (FE) regression with time dummies and I would…
Error after pscore commandDear members, I received this message after running pscore Estimation of the propensity score outc…
Interpretting coefficients when dependant variable is percentage changeDear Statalist, I think this is more of a statistics question rather than a Stata-specific question…
Label VariablesHello, I have a stata file named "survey.dta" which contains the following labelled data: ident…
Subscribe to:
Post Comments (Atom)
0 Response to Extracting last year from $S_DATE
Post a Comment