Hi all
First, let me say I am a 4th-year psychology student doing her Honours thesis, I am NOT a statistician so my knowledge of Stata is probably very basic compared to most users here! I need to create a new variable as follows:
existing var 1 - children under 5? yes/no where yes = 1, no = 2
existing var 2 - children under 16? yes/no where yes = 1, no = 2
new var - children between 5 and 16 years
I am looking at both gen and egen functions but I can't see a way to tell Stata that I want the new variable to include those who responded No/2 to existing var 1 and those who responded Yes/1 to existing var 2.
Can anyone help me out? I'm using Stata/MP 17.0
thank you!
Mel
Related Posts with Help to generate a new variable using 2 existing variables
T Tests and Wilcoxon Tests export to MS Word or MS ExcelHello Members I had been working on EViews for some time, I shifted to Stata now, since I am new, I…
multicollinearity test variables in a panel dataHi, how can I run a multicollinearity test in Stata 12 between variables in a panel data? Thanks! …
Solve Macroeconometrics Model and ForecastI am trying to solve a macroeconometrics model of my country using STATA. Model has 7 endogenous var…
Complex Reshape Long to WideDear Stata Users I am dealing with a complex reshape wide problem. Here is an input data: Code: …
problem with Ivreg2 resultDear All, After running my regression with ivreg2, in last portion of the result I saw error massage…
Subscribe to:
Post Comments (Atom)
0 Response to Help to generate a new variable using 2 existing variables
Post a Comment