Hello.
I'm working with survey data from the Eurobarometer survey. I want to create a new variable, which will assign countries values based on Freedom House rankings for government transparency.
I have tried using this code: generate govt = 3 if cntry_eu == 2, govt = 4 if cntry_eu == 3, govt = 2 if cntry_eu == 4 ........ etc.
But stata only recognise one line of code, and when I tabulate the new variable it gives me the number of induviduals within that first country.
How can I add on more values? And is it possible to add labels to the numeric country codes in the creating of the new variable, so that the results are easier to interpret?
Many thanks for all kinds of help!
Related Posts with Create new variable of survey data
Using hyphens in varlists for duplicatesI'm using Stata 14.2 and was trying to use the duplicates command, when I experienced some strange b…
Levels of variables "dropped because of estimability" when running a nested regressionWhen I run a nested regression, I'm getting the following notes: note: 1.deprivationquintile dropped…
xtsccI have 17 countries across 37 years. Can I use -xtscc depvar indepvars i.year, fe? Is it better to i…
Duplicating time observations in panel data in stataHello Stata community, I am looking to duplicate the time observations in a panel data 17 times, wh…
Exporting Variables to ExcelHi! I have created a few variables that I'd like to export to an excel file. I have variables rf1 th…
Subscribe to:
Post Comments (Atom)
0 Response to Create new variable of survey data
Post a Comment