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
dummy=1 over a period when a condition satisfiesIt is tough to explain but i will try my best. "Surge" is the dummy variable i created for capital f…
margins after svyI am looking at the differences in wages for specific occupations by marital status. Note marital st…
Propensity score matching (psmatch2) for clustered dataHello everyone, I'm trying to implement propensity score matching (PSM) in a situation of clustered…
Computational time of lasso2 vs. rlassoHello, I am using the lasso2 package for model building and variable selection and have some questi…
bootstrap with replacement - roctabHi, I am running roctab to find the ROC area. We have repeated measures - some subjects have two ob…
Subscribe to:
Post Comments (Atom)
0 Response to Change observations values
Post a Comment