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
Difference in Difference Parallel Trends testDear Statalisters, I am running a Difference in Difference analysis. In order to test whether treat…
interflex command failedHello everyone, I have a problem with the results of the interflex command. I had tried to look if …
update available of abm_grid: A Mata class for managing a square grid for agent based modelsAn update of the abm_grid class is now available on GitHub: https://github.com/maartenteaches/abm_gr…
Converting ExcelI need to import 3 excel files with different columns/rows into Stata. Excel #1 looks like this: …
F test values are missing, I tried to understand it from the previous post but could not get it.I am very new stata, please pardon me if i sound stupid. I rana regression with xtreg fixed effect w…
Subscribe to:
Post Comments (Atom)
0 Response to How to transfer multiple values stored under a local macro into a variable
Post a Comment