Announcement

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

  • Creating stock portfolios by R&D ratio with yearly rebalancing

    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

    Click image for larger version

Name:	Unbenannt.JPG
Views:	1
Size:	99.3 KB
ID:	1448432

  • #2
    You didn't get a quick answer. You'll increase your chances of a helpful answer by following the faq on asking questions - provide Stata code in code delimiters, readable Stata output, and sample data using dataex. It is not recommended to post pictures or files.

    You have asked a pile of questions. This topic has been addressed repeatedly on this list serve in recent years. As for Stata "Stata can't find the directory to save it" - do you mean you can't download a package to your ado subdirectories or the current subdirectory for your project? Are you saying Stata can't save the package or can't find the package afterwards? Stata should be able to save the package - do you not have permission to modify the subdirectory for ado's?


    Comment


    • #3
      I always get the error message "cannot write in directory U:\Documents\Stata\plus\d". There is no such directory on my PC. I use an university license on my own PC. I have researched this problem on this forum, too. It seems that new packages are not saved locally, but rather on a server?

      Comment

      Working...
      X