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
foreachi am using Stata 14. levelsof cropcode, local(code) foreach x in local `code' { tabstat acd ack if c…
Panel data graphsHi there, I have a quick question. I am working with a panel data and I would like to get some twow…
Foreach RegressionHi, I want to regress w0.............w30 one by one on variables x, y, z and save the results from e…
Finding mean in a loopHello there, Got a question. I am working on a panel data and I am trying to find the mean of some …
Calculate the size of the boardDear Statalisters, I am researching on corporate governance and need to calculate the board size fo…
Subscribe to:
Post Comments (Atom)
0 Response to Generating new variable
Post a Comment