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 ua-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.
This UA-cam channel is literally a lifesaver for me in grad school, thanks.
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
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 ua-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
Why not showing where's available the link on the website and how to put here
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!
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
Love your video. To the point and spot on. Keep up the great work :-)
How do I convert categorical variable to continuous variable?
Solved my problem, thank you very much!
Thanks from Afghanistan
Thank you very much!!! Helped me a lot!!!!
Thank you! This was helpful!
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
Thanks a lot, this video is really good.
Nice! thx bro
Very helpful.
Very helpfull, thanks :)
That video does not help at all. Same problem from the comments below
Thank you
thank you sir
thanks man
didn't work
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
thx
Capo