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
PPML Fixed EffectsHi, I have a question: Given this gravity model estimated with the PPML estimator with fixed effec…
Poisson regression | time-from-event count dataApologies in advance if this is a daft question from a healthcare professional with little/no experi…
Help with interrupted time series margins plotHello all, I am working on graphing yhat of death by month to illustrate the impact of a health car…
discrepancies in estimates between sumdist and pshareHi friends, I have income data for two populations (population id=1 and 2). I have collapsed my dat…
Independent variables change signs when interaction is includedHey stata experts, I am currently writing my master thesis, therefore using stata. I have a question…
Subscribe to:
Post Comments (Atom)
0 Response to Help to generate a new variable using 2 existing variables
Post a Comment