Hi all!
I hope you can guide me in the following question. In te following dataset:
id Ya Yb id_2
1-1 .6249384 .7929984 1-1
1-1 . . 1-2
1-1 . . 2-1
1-2 . . 1-1
1-2 .6531338 .5850651 1-2
1-2 . . 2-1
2-1 . . 1-1
2-1 . . 1-2
2-1 .8717756 .890541 2-1
How can I replace the value of Ya for id == 1,1, for all observations that meet id == 1,1?
and so also for Yb, but with the variable id_2?
The goal is to get the following dataset:
id Ya Yb id_2
1-1 .6249384 .7929984 1-1
1-1 .6249384 .5850651 1-2
1-1 .6249384 .890541 2-1
1-2 .6531338 .7929984 1-1
1-2 .6531338 .5850651 1-2
1-2 .6531338 .890541 2-1
2-1 .8717756 .7929984 1-1
2-1 .8717756 .5850651 1-2
2-1 .8717756 .890541 2-1
Thank you very much in advance.
Greetings,
Related Posts with Replace values of one variable according to the categories of another
Prediction interval (not confidence interval) calculations for glm w/ robust VCE model?In reference to the two threads below, did anybody ever figure out how to get prediction intervals/i…
Problem with Gen & string/numeric variable conversionDear forum members, I am new to Stata and having a problem that I can't seem to find a straightforw…
5*5 bivariate dependent sorting for portfolio creation Code: * Example generated by -dataex-. To install: ssc install dataex clear input str15 companies b…
Meta analysis using stata 15How can I test/visualize subgroup difference. I use metan by(subgroup) but I can’t get the differenc…
Difficulty with margins: Wald estimate discrepency between ivreg2 and marginsHello, I am trying to estimate the Wald estimand and calculate standard errors using margins and sue…
Subscribe to:
Post Comments (Atom)
0 Response to Replace values of one variable according to the categories of another
Post a Comment