I'm very new to stata and tried the following not achieving my goal:
I want to divide each value for specific observations (in my task from line 2 until the end of dataset) to corresponding values from line 1 for a set of variables and than do a operation. What I tried so far is start with a loop but then I stuck on how to divide each value from the lines 2/_N through line 1. Maybe this isn't the right aproach.
I want to divide each value for specific observations (in my task from line 2 until the end of dataset) to corresponding values from line 1 for a set of variables and than do a operation. What I tried so far is start with a loop but then I stuck on how to divide each value from the lines 2/_N through line 1. Maybe this isn't the right aproach.
foreach var of local `finance' {
forvalues i = 2 / `=_N'{...}
}Here's a sample of my dataset:
Code:
* Example generated by -dataex-. For more info, type help dataex clear input double(bf21 bf211 bf212 bf22 bf23 bf2s bf31 bf32) 52959806 49517535 3442271 6901081 20877841 80738728 826841 70335922 243700 189700 54000 4694 46938 295332 0 0 452804 313924 138880 33989 144897 631690 11911 450439 231725 231725 0 20571 152478 404774 0 396461 625971 625971 0 13793 110408 750172 0 416597 364389 295283 69106 209049 586670 1160108 0 3191727 384757 352261 32496 0 121924 506681 0 0 290956 88670 202286 0 127981 418937 0 927920 284300 284300 0 0 308620 592920 0 1893765 916710 824028 92682 0 371688 1288398 0 1351755 end
Comment