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
When should we exclude an independent variable out of the regression?In my case, I have two questions that I want to ask here relating to correlations among variables: …
Clarify package: probit with interaction between variablesHi Statalist, I am doing a simple probit model in which the dependent variable is "work" (1 if the …
Reclink: Type mismatch for a same type variable?!Hi, I'm new to this community. Nice to meet you all. I'm trying to run a reclink to match fuzzy dat…
oaxaca_rif with bootstrap standard errors and probability sample wiehgtsDear all, I implement user written command oaxaca_rif, which preforms Oaxaca Blinder decomposition …
Help with "Split"- splitting a string variable that has varying numbers, text and symbolsHi all, RE: split using Stata version 16.0. As part of data cleaning my data sets I need to genera…
Subscribe to:
Post Comments (Atom)
0 Response to Multiplying observations in a variable list
Post a Comment