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
The standard deviation of common stock returns measured over the previous years.Hi everyone, for the replication of the following study: Bugeja, M., Matolcsy, Z.P., and Spiropoulo…
How to insert multiple values in StataDear Statalist, I have a dataframe like: householdno foodcount foodcode 1 1 67 1 2 65 …
Mata function -truish()-Dear All, I occasionally find the function truish() mentioned in other people's code, such as here:…
Added value of multivariate regression model (mvreg)Dear forum members, I am using a multivariate model (mvreg) to analyse the effect of many control v…
add values to certain groupsHi everyone, I have a dataset on companies, its financial years, matching financial numbers and err…
Subscribe to:
Post Comments (Atom)
0 Response to Multiplying observations in a variable list
Post a Comment