Hi,
I would like to create 10 quintiles of stock portfolios, sorted by companies' R&D ratios. Additionally, these portfolios should rebalance each year and only companies with positive R&D spendings ("xrd") should be considered. Companies withouth any R&D should be placed in portfolio "0". I already tried many combinations of bysort, xtile, egen and foreach but Stata always tells me that these functions do not work together. Downloading any packages is not possible, since Stata can't find the directory to save it. I also tried a loop, but actually I don't want a portfolio variable for each year. I just want one portfolio variable. It would be nice if someone could help me out.
Thanks,
Alex
I would like to create 10 quintiles of stock portfolios, sorted by companies' R&D ratios. Additionally, these portfolios should rebalance each year and only companies with positive R&D spendings ("xrd") should be considered. Companies withouth any R&D should be placed in portfolio "0". I already tried many combinations of bysort, xtile, egen and foreach but Stata always tells me that these functions do not work together. Downloading any packages is not possible, since Stata can't find the directory to save it. I also tried a loop, but actually I don't want a portfolio variable for each year. I just want one portfolio variable. It would be nice if someone could help me out.
Thanks,
Alex
Comment