Hi,
I have pairs of variables (i.e. p1 q1, p2 q2, etc. The final pair is
pfinal and qfinal). All I want is that when either p`i' or q`i' has a
blank, it takes the value of 0 while the other retains its value. When
both p and q are blank, I dont want anything to be changed. See
example below.
Thanks,
Hugh
What I have now:-
Obs # p1 q1 p2 q2 pfinal qfinal
1 5 1 1 3
2 7 5
3 8 1
4 3 9 9
What I want:-
Obs # p1 q1 p2 q2 pfinal qfinal
1 5 1 0 1 3 0
2 7 0 0 5
3 8 0 1 0
4 0 3 9 0 9 0
*
* For searches and help try:
* http://www.stata.com/support/faqs/res/findit.html
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/