Hi guys!
I want to calculate the cash flow volatility for every firm (gvkey) and every year (year) in my dataset, using the standard deviation of cash flows for the previous 5 years. To do this, I first claculated the cash flow (gen cfl=(oibdp-xint-txt-dvc)). For example, to get the cash flow volatility for a firm in year 2000, I calculate the standard deviation of the cash flows of this firm for the years from1985 to 1989. The cash flow volatility for the same firm in year 1991 is claculated as the standard deviation of cash flows from 1986 to 1990, and so on. Since my dataset is very large, it is necessary to use a loop. Can somebody help me with this problem?
Cheers, Jamie
I want to calculate the cash flow volatility for every firm (gvkey) and every year (year) in my dataset, using the standard deviation of cash flows for the previous 5 years. To do this, I first claculated the cash flow (gen cfl=(oibdp-xint-txt-dvc)). For example, to get the cash flow volatility for a firm in year 2000, I calculate the standard deviation of the cash flows of this firm for the years from1985 to 1989. The cash flow volatility for the same firm in year 1991 is claculated as the standard deviation of cash flows from 1986 to 1990, and so on. Since my dataset is very large, it is necessary to use a loop. Can somebody help me with this problem?

Cheers, Jamie
Comment