Hi.
I have made a survey experiment with two experimental groups. In Stata I now have two variables (var1 and var2) for each group's opinion to a given question (values from 1 to 7).
I now want to create a new third variable that indicates if the respondent is part of group 1 or 2. So all members of var1 should have value 1 and all members of var2 should have value 2.
I guess it is quite simple, but I can't really figure out how to do it.
Hope someone is able to help. Thank you!
- Nanna
Related Posts with Generating new variable
Add mean, sd and median names to table outputHi all I wonder if its possible add mean, sd and median names to a table output , example: Code: …
Is there any difference between "Sort X Y" versus. "Bysort X Y: gen A=1"I know in Bysort you have to generate something. But other than that will using Sort X Y vs. Bysort …
Problems with spread out rows when using tableHi Statalisters, I seem to have found some unexpected (to me) behaviour from the -table- command. A…
Missing F-Stat for regression with robust SE - Not a problem with singleton dummy variables Dear Statalist community, Currently I am conducting an event study on ad hoc disclosures. The regr…
Type missmatch, dropping string observations from a VariableHello, Starting a new thread since I finally need something different from what I had before. How…
Subscribe to:
Post Comments (Atom)
0 Response to Generating new variable
Post a Comment