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
Taking yearly average in panel data.Hello, I am working on a balanced panel data set whose example is shown below. I want to take yearl…
P trend valueHello, I'm trying to calculate the P trend value for an event risk according to the different disea…
How do I construct probit models from panel dataI have a bunch of health metrics that needs to be regressed on each other in a probit model: Code…
Calculating Relative EntropyDear Statalist, I would like to calculate 'relative entropy' (also known as Kullback-Leibler Diverg…
non parametric test with two variables?Dear all, I have a dataset containing 157 firms identified by a companyid variable, besides i have t…
Subscribe to:
Post Comments (Atom)
0 Response to How to transfer multiple values stored under a local macro into a variable
Post a Comment