a question about stata code# Economics - 经济
j*m
1 楼
i have a set of dummies, say d1 d2...d9, and i have another variable, say p.
now i want to multiply each dummy by p, and generate a new set of variable,
say pd1=p*d1,pd2=p*d2,....
how can i do that in once. i know the cumbersome and stupid way is to
generate one by one, like
gen pd1=p*d1
gen pd2=p*d2
...
thanks.
now i want to multiply each dummy by p, and generate a new set of variable,
say pd1=p*d1,pd2=p*d2,....
how can i do that in once. i know the cumbersome and stupid way is to
generate one by one, like
gen pd1=p*d1
gen pd2=p*d2
...
thanks.