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
How to remove the average from marginplotHello, I got 2 continous variables with an interaction, I'm trying to visualise that as a graph, h…
countries and longitudinal dataDear Statalisters, I have a dataset, which involves the fifth wave of SHARE DATA and I want to exam…
Causal Mediation on imputed dataDear Statalisters, To carry causal Mediation analysis, I am using the Mediation package (Medeff com…
Identifying causes of multicollinearityHi! We are struggling with high VIF's in our model (in which we are using panel data with our main …
Difference-in-Difference Regression with multiple time periodsDear Statalists, I am currently investigating Acquirer Performance before and after M&A deals. …
Subscribe to:
Post Comments (Atom)
0 Response to Converting String Variables Questions
Post a Comment