Awesome, it works, thanks! however, how can I use this info to define another row? like create a new vector Q Q=p (a numeric variable ) if lab='put'; Q=c (a numeric variable ) if lab='call'; Q=(p+c)/2 if lab='mix'; The vector should be continuous, like p c lab Q 1 2 put 1 2 3 call 3 4 5 call 5 6 7 mix 6.5
You can use essentially the same syntax to construct Q like this:
lab = choose(k<k0,'put','mix');
lab = choose(k>k0,'call',lab);
Q = choose(k<k0, p, (p+c)/2);
Q = choose(k>k0, c, Q);
print k0 k lab p c Q;
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Registration is open
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss. Register now and lock in 2025 pricing—just $495!