Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Conditional loop analysis with sums in panel data

    Dear All,

    I have an unbalanced data of
    company id
    (i)
    country code
    (c)
    year
    (y)
    ratio-1
    (r1)
    ratio-2
    (r2)
    ratio-3
    (r3)
    ratio-4
    (r4)
    ratio-5
    (r5)
    1 ≤ i ≤ 1587 1 ≤ c ≤ 18 2005 ≤ y ≤ 2021 0 ≤ r1 ≤1 0 ≤ r2 ≤1 0 ≤ r3 ≤1 0 ≤ r4 ≤1 0 ≤ r5 ≤1
    where 1587 companies from 18 different countries report 5 different financial ratios annually from 2005 to 2021.

    As such, there are 26979 rows (1587 * 17) in the data (1587 companies and 17 years) in which each company is assigned to a single country in all years.

    I want to generate a new variable (Xa,y) for each and every row as in the attached pdf file. Eventually, all companies should have a unique "Xa,y" for each
    year thus 17 (number of years) different "Xa.y"s in total.

    I appreciate your help with the code for Xa,y.

    Best,

    Lütfi
    Last edited by Lutfi Ozturker; 28 Jun 2022, 03:22. Reason: I couldn't properly post the formula for Xa,y so I attached it in a pdf file

  • #2
    please see the file attached
    Attached Files

    Comment

    Working...
    X