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
gen whole lot random variables (and random order) efficientlyHi all, One of the statistical computations that I've been working on involves assigning 10,000 col…
Need help in estimating random intercept value for each group for reporting into a journal summary table???I would like to estimate a random intercept linear regression model based on several covariates, and…
Generate a variable equal to 1 when a countryI'm sorry, my screen froze and I posted this topic by mistake. Here is the actual link : https://www…
TWFE for pooled cross sectionsHi, I currently have a dataset looking at 500 days, which is from 3rd April 2018 to 16th August 2019…
Why is My Stata for-loop Code Wrong?I just want to compute descriptive statistics of the categorical time-invariant variables in the att…
Subscribe to:
Post Comments (Atom)
0 Response to Generating new variable
Post a Comment