Hello,
I am relatively new to STATA, with only a couple months experience and not much string experience.
I want to create a variable that stores 10 separate different words.
Ex:
animal:
cat
dog
lizard
bird
etc
I tried doing something like
gen animal = "cat" + " " + "dog"....
but that just gave me:
animal = cat dog lizard bird
and the results aren't all split up. I am doing this so that I can basically use this string value as the qualifier for an f statement that will do a command when the string is equal to one of the word values.
Thanks!
Related Posts with Creating a string variable with multiple different word values
What is the syntax to retrieve r-class stored results in multiple equation models, like bivariate poisson, var, or sure?I can retrieve coefficient estimates by: gen Cf = [equationname]_b[varname] ,no problem! But I am ha…
using gravity equation to control for the impact of antidumping duties on trade flowsHello Statalist members, I'm currently working on my bachelor thesis and therefore I'm analyzing th…
Generalised probit model and dependent categorical variablesHi, I want to estimate a generalised probit model in which the dependent variable is wealth in quin…
repeated time values within panel r(451)Hey guys, I got the error: repeated time values within panel r(451), when I set the list of firms of…
Creating a variable for a "life event" in panel data which occurred in different waves for different individualsHi there, I am using the BHPS and testing how quickly respondents' happiness measures revert back to…
Subscribe to:
Post Comments (Atom)
0 Response to Creating a string variable with multiple different word values
Post a Comment