Hello,
How can I transfer multiple values stored under a local macro into a variable?
Below is what I tried:
gen mnbScore = .
python: mnbScore1 = Y_mnb_score.tolist()
python: mnbScore1_str = ' '.join(str(e) for e in mnbScore1)
python: Macro.setLocal('mnbScore1', mnbScore1_str)
// the reason for the 'replace mnbScore = `mnbScore1' ' is because
// if I try to do ' roctab compliance `mnbScore' ',
// Stata throws the following error:
// "factor-variable and time-series operators not allowed"
replace mnbScore = `mnbScore1' // This line causes an error
How can I store the values under the macro `mnbScore1' under the variable 'mnbScore'?
and if there is no way to do this, how can I avoid this "factor-variable and time-series operators not allowed" error (so that I wouldn't need to transfer the values from local macro to a variable)
Thank you,
Related Posts with How to transfer multiple values stored under a local macro into a variable
Translation, string date recognized as the week dateHi, I want to get some advice. I have a date variable that represents week. For example, 2014023, is…
Forced variables dropped when using lassoDear Stata Users, I am running a regression through the lasso command in Stata 16. My aim is to use…
Model test for OLS conditions and if statementHello, I am working with a multiple linear regression model. I have to test wether my model meets t…
6-month Cumulative ReturnDear Statalists, I know there are couple of posts about cumulative returns but unfortunately none of…
Foreach regression loop - Stata 16Hi, I am trying the 'foreach' command for the first time and cannot figure out the problem in my cod…
Subscribe to:
Post Comments (Atom)
0 Response to How to transfer multiple values stored under a local macro into a variable
Post a Comment