Hello, I recently started using STATA however I have a datset with approximately 7 million observations and about 30 variables, resulting from a merge of two datasets.
I would like to update / replace the values of some observations that have been matched from Var1 according to the values of another variable Var2.
As an example, imagine that for observation 1, the value of Var1 = 0.5 to Var2 = 10, however, I wanted to change it to Var1 = 2.55 to Var2 = 10.
I emphasize that Var2 is a string and although I have done "encode" and try to use the resulting Var3 = 10 with the replace command it appears "(0 real changes made)". When I use "update Var1 = 2.55 if Var3 == 10" the error r (198) - invalid syntax appears.
I would appreciate any help or tips. Thank you!
Related Posts with Change observations values
Bootstrapped CI for effect size for one sample t-testHello, I need to test if across a series of studies, the mean response is significantly different f…
recovering the estimate of an interaction term using margins when the base level of all zeros is not includedHi Fellow Statalisters, In a recent posting (https://www.statalist.org/forums/forum/general-stata-d…
catplot - how to show n to the left of the bars, percentages within bars, and mean values outside the bars (to the right)Dear all, I am using the community-contributed command catplot from SSC in Stata 16.1 in order to p…
One line code for performing arithmetic operation (here multiplication) while merging two datasetsSuppose, I have two datasets given below, now how can I merge the datasets so that resulting values …
finding keywords in string variablesDear Statalister I'm working on a dataset and I need to create a dummy variable equals 1 if the str…
Subscribe to:
Post Comments (Atom)
0 Response to Change observations values
Post a Comment