Hi,
I have two variables: 1) age of initiating cigarette use with values from 10-23 and 2) age of initiating hookah use with values from 11-19. Also, these variables are not mutually exclusive and so people could have used both products at different ages. For example, a person could have first-tried a cigarette at 10 years and hookah at 13. I want to combine these variables so that I can create a new variable on age of initiating tobacco substances with values that reflect both variables. I therefore, do not want the variables to simply add up the values. I want the variable to show the lowest age of initiation for each age.
ex.
ageofciguse ageofhookahuse
16 15
15 16
10 17
12 22
11 11
14 19
15 16
19 18
16 14
Ideally, I would like to create a new variable
ageoftobaccouse
15
15
10
12
11
14
15
18
14
Next, how can I do this for more than two variables?
Related Posts with Merging two continuous variables in the same dataset
Saving ado fileDear Statalist, I am having difficulties with saving ado file. I don't understand where to save the…
Probit with endogenous binary regressorHello I am using ivprobit for my regression with a binary outcome variable. The help file suggests t…
Generating geographical group variables from Household IDHi, I am using STATA 14, I am interested in generating a new variable from household ID, which is a…
Propensity Score MatchingHi everyone, I am still figuring out PSM for my study.I am having trouble in the first step matchin…
Correlation Coefficient and logarithmic variablesHi, I am working on some data containing 1400 observations over a 7 year period, whereas the observ…
Subscribe to:
Post Comments (Atom)
0 Response to Merging two continuous variables in the same dataset
Post a Comment