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
ppmlhdfe error when no independent variable is includedDear STATA community, I run into error when I run ppmlhdfe with no independent variable. For exampl…
making graphs into APA 7th formatHi again, Does anyone know how to edit/export graphs such as plots into APA 7th formatting? The Grap…
plotting the OR & CIHi all, I am a 4th-year psychology student doing my Honours thesis and my supervisor has suggested …
LR intervalDoes anyone have code for estimating the interval Likelihood ratio? I have done some analyses using …
ranking and creating a dummy variable based on quantilesHello, I have this panel data. Array I want to rank the variable (REV_CH_mean5) within each indust…
Subscribe to:
Post Comments (Atom)
0 Response to How to transfer multiple values stored under a local macro into a variable
Post a Comment