If your data is stored as text say female and male and you want to make it numeric variable 1=Male 2=Female then follow the steps>Menu>Data>create or change data>other variable-transformation commands>Encode value labels from string variable> then choose source variable (string) and name your new numeric variable (gender2). It works so nice. I hope it helps
For everyone where it didnt work: "If your data is stored as text say female and male and you want to make it numeric variable 1=Male 2=Female then follow the steps>Menu>Data>create or change data>other varaible-transformation commands>Encode value labels from string variable> then choose source variable (string) and name your new numeric variable (gender2). It works so nice. I hope it helps" Credits to th-cam.com/channels/xyHocrrLQPd1SooIGH2sDQ.html
You probably have some missing observations indicated as missing data. As an example, your last obs might say NA. Then tell the command to exclude NA. The basic problem is that this function is written so extremely simple that typical time series problems.
i think that it is important to make a tab1 to all the variables we would like to "destring". Tab1 var1 var2 var3 avoid to do separeately tab var1, tab var2, etc. For "destring" ALL YOUR DATA should be a number (in a string format, obviously) because If you have in your variable any "text" for example "no data", Stata will not execute the order we want. That was my own experience.
If your data is stored as text say female and male and you want to make it numeric variable 1=Male 2=Female then follow the steps>Menu>Data>create or change data>other variable-transformation commands>Encode value labels from string variable> then choose source variable (string) and name your new numeric variable (gender2). It works so nice. I hope it helps
My case is: Variable X contains nonnumeric characters; no replace
Or second try: destring VarX, generate(VarX)
VarX contains nonnumeric characters; no generate
This TH-cam channel is literally a lifesaver for me in grad school, thanks.
For everyone where it didnt work:
"If your data is stored as text say female and male and you want to make it numeric variable 1=Male 2=Female then follow the steps>Menu>Data>create or change data>other varaible-transformation commands>Encode value labels from string variable> then choose source variable (string) and name your new numeric variable (gender2). It works so nice. I hope it helps"
Credits to th-cam.com/channels/xyHocrrLQPd1SooIGH2sDQ.html
Oh man I knew it and then I forgot and now your message saved me from unnecessary frustration. Thanks a lot!
@@MazDTdK No problem dude. good luck with your work
Thank you, this helped!!
Thanks mate
I followed your guidance ... yet I cant convert it.
destring credit_line, generate(credit)
credit_line contains nonnumeric characters; no gene
> rate
You probably have some missing observations indicated as missing data. As an example, your last obs might say NA. Then tell the command to exclude NA. The basic problem is that this function is written so extremely simple that typical time series problems.
@@MrRobertLake Same problem. Checkd the data, I have no missing observations.
You need to use encode
Use the 'force' option or use encode
@@Non-disjunction Try this destring strVar, generate(numVar) force
Hi, im working with stata right now. And i have tried with your steps, but it said "no generate". Can you help me with this problem? Thanks
Hello, i have the same problem, did you find any solution?
delete the commas, you can try excel first
I just checked the first box "Convert nonnumeric strings to missing values". then it replaced my bank cells with "." and it worked for me.
@@ThiriWinHtike wow cool, thanks. you saved me
deleting commas have worked, thanks :)
Thank you so much sir!
Short and Concise
Really helpful!
Why not showing where's available the link on the website and how to put here
Thanks from Afghanistan
Thank you! This was helpful!
Solved my problem, thank you very much!
Thank you very much!!! Helped me a lot!!!!
Nice! thx bro
Very helpful.
Love your video. To the point and spot on. Keep up the great work :-)
Thanks a lot, this video is really good.
How do I convert categorical variable to continuous variable?
That video does not help at all. Same problem from the comments below
Do you know how to correct error 200 in STATA, that one that says no observations. If anyone in the comment knows please let me know
Very helpfull, thanks :)
Thank you
thanks man
thank you sir
thx
Capo
Does not work for me ... STATA is killing me, will use Eviews
i think that it is important to make a tab1 to all the variables we would like to "destring". Tab1 var1 var2 var3 avoid to do separeately tab var1, tab var2, etc. For "destring" ALL YOUR DATA should be a number (in a string format, obviously) because If you have in your variable any "text" for example "no data", Stata will not execute the order we want. That was my own experience.
I´m with R, Stata is shit for handle variables. I have to use it because my boss
didn't work