In a dataset of multiple variable lists, I would like to multiply the value of only selected variables in one variable list by 4. Namely, I want to keep the observations unchaged if the observation concerns the age_group of <1 years and 95 plus (age_group variable list is not numeric). For all the other cases, I am trying to multiply the observation values by 4. I initially used this command: gen new_var = old_var * 4 if age_group != "<1 year" but I cannot incorporate 95 plus age group in this command. Also, in a new variable list, observations for <1 age group are deleted, while I would just like to keep the previous value. Thanks!
Related Posts with Multiplying observations in a variable list
Why doesn't clustering change anything?Hi all, I have panel data xtset across 3 waves of children's weight and parents employment status, …
grc1leg alternatives.Dear All, I am using Stata MP on my universities Linux based super computer and it does not have us…
Merging two datasets with specific dates of start and end of period within a yearI am running on panel project where I have to merge and match two dataset . My first dataset is a se…
Creating variables out of duplicatesHi, as this is my first post, I hope I meet all the criteria. I am using a large panel data set on a…
Marginal effects on predicted marginal probability after mvprobitHi! I ran a multivariate probit regression on 3 binary dependent variables using Capellari and Jenki…
Subscribe to:
Post Comments (Atom)
0 Response to Multiplying observations in a variable list
Post a Comment