Hello everyone,
I am hoping that you all may be able to help with a question that I have been unsuccessfully trying to find an answer to. I would like to create a numeric variable that captures the count of characters in a string variable.
For example, in the dataset auto I would like to create a new variable "new_foreign" that includes the value 8 (corresponding to domestic) and the value 7 (corresponding to foreign).
Is there anyway to do this? The dataset I am working with has many thousands of cases and the character counts for the string variables I am interested in can also be quite long. Thank you all!
Best,
Daniel
Related Posts with Converting String Variables Questions
Random Effects with time Fixed Effects for Probit modelHello, I am wondering the description on the probit model with firm-level random effects and time fi…
Margins after xtnbreg, fe exposure()Hello, I am running negative binomial regression on panel data of counts (panel = county, time = da…
Stata stationarityHello guys, I am currently trying to train myself on non-stationarity, seen as I will probably have…
New version of eclplot on SSCThanks as always to Kit Baum, a new version of the eclplot package (described as below on my website…
How to combine summary stats and regression tables in StataI am interested how some variables differ by gender. I want to create a table showing the means and …
Subscribe to:
Post Comments (Atom)
0 Response to Converting String Variables Questions
Post a Comment