Hi, I'm working with trade data and I want to get a substring from a numeric code that includes the code of the country of origin, destiny and type of product. But I keep getting the type mismatch error. Here's my code:
gen code1 = real(substr(code,1,3))
Related Posts with Type mismatch when trying to get substring
How do i compute the geometric increase rate of a variable in a panel dataset?Hello everyone, I'm new to Stata and this forum. If I do something wrong, please tell me. I would li…
Analytical weight in a count model with an exogenous treatmentHello, I have a quick question regarding weights in 'teffects'. Could you please point me towards t…
Dependent variable comes in months, how to build model?I am studying the determinants of unemployment spells. My dependent variable is unemployment spell (…
nested loopsI divided a variable in quintiles and I want to summarize a list of variables for each quintiles. I …
Mata debugging strategiesMight anyone suggest helpful references on strategies for Mata debugging? …
Subscribe to:
Post Comments (Atom)
0 Response to Type mismatch when trying to get substring
Post a Comment