Dear S-Plus users:
I have three variables :
Y1 Y2 dummy
1.2 1.0 1
1.4 1.5 0
1.5 0.9 1
1.7 1.9 1
1.9 1.7 0
I like to replace those elements of Y1 by the elements of Y2 for which
dummy=0 if these elements of Y1 are smaller than the corresponding elements
of Y2.
That is, I like to have the resultant new Y1 as
Y1
1.2
1.5
1.5
1.7
1.9
Please notice that the second element of new Y1 is not 1.4 any more but
replaced by the second element of Y2 [dummy==0]. However, the last element
of Y1 is not replaced by the corresponding element of Y2 even though
corresponding dummy=0 as 1.9> 1.7.
How can I accomplish this? I am using S+ 2000.
Any help will be appreciated.
Regards,
Enayet
LEGAL NOTICE
Unless expressly stated otherwise, this message is confidential and may be
privileged. It is intended for the addressee(s) only. Access to this E-mail by
anyone else is unauthorized. If you are not an addressee, any disclosure or
copying of the contents of this E-mail or any action taken (or not taken) in
reliance on it is unauthorized and may be unlawful. If you are not an
addressee, please inform the sender immediately.
|