Dear statalists,
I would really appreciate your help. I'm currently analysing data for my master thesis and I've experienced above mentioned problem.
A small part of my sample looks as following:
produkt_hilfe1 produkt_hilfe2 produkt_hilfe3 produkt_hilfe4 produkt_hilfe5 produkt_hilfe6
1.048171 1.066638 1.049848 1.027627 1.076792 1.096686
1.048171 1.066638 1.049848 1.027627 1.076792 1.096686
1.048171 1.066638 1.049848 1.027627 1.076792 1.096686
1.048171 1.066638 1.049848 1.027627 1.076792 1.096686
1.048171 1.066638 1.049848 1.027627 1.076792 1.096686
What I want to do is multypling each observation with corresponding observation of the other variables like this:
gen varibale = produkt_hilfe1 * produkt_hilfe2 * produkt_hilfe3
gen variable2 = produkt_hilfe2 * produkt_hilfe3 * produkt_hilfe4
and so on...
For this small part it's no problem to do this manually, but my dataset consists of 360 of such variables.
Unfortunately I can't found any solution for this problem on this page, in the pre_april 2014 archievs or somewhere else in the net. Furthermore my many tries using different loop-variations didn't work out.
So to subsume my problem, I would like to multiply observations of a particular range of variables.
Like I wrote I would really appreciate your advice and thanks in advance for any help.
Kind regards,
Martin
I would really appreciate your help. I'm currently analysing data for my master thesis and I've experienced above mentioned problem.
A small part of my sample looks as following:
produkt_hilfe1 produkt_hilfe2 produkt_hilfe3 produkt_hilfe4 produkt_hilfe5 produkt_hilfe6
1.048171 1.066638 1.049848 1.027627 1.076792 1.096686
1.048171 1.066638 1.049848 1.027627 1.076792 1.096686
1.048171 1.066638 1.049848 1.027627 1.076792 1.096686
1.048171 1.066638 1.049848 1.027627 1.076792 1.096686
1.048171 1.066638 1.049848 1.027627 1.076792 1.096686
What I want to do is multypling each observation with corresponding observation of the other variables like this:
gen varibale = produkt_hilfe1 * produkt_hilfe2 * produkt_hilfe3
gen variable2 = produkt_hilfe2 * produkt_hilfe3 * produkt_hilfe4
and so on...
For this small part it's no problem to do this manually, but my dataset consists of 360 of such variables.
Unfortunately I can't found any solution for this problem on this page, in the pre_april 2014 archievs or somewhere else in the net. Furthermore my many tries using different loop-variations didn't work out.
So to subsume my problem, I would like to multiply observations of a particular range of variables.
Like I wrote I would really appreciate your advice and thanks in advance for any help.
Kind regards,
Martin
Comment