Announcement

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

  • Problem of missing observations in CAPM estimation

    I have following variables from raw data and I want to estimate the return of Stock PG using CAPM model. I found that there are a lot of missing observations due to the date gaps since trading does not occur in the weekend and during public holidays. How can I fix this problem? Should I use a new date variable?

    Moreover, after fixing of date, i use the following commands to get the estimation result:

    tsset date, d
    gen lnPG=ln(PG)
    gen rPG=100*(lnPG-L.lnPG)
    gen rirf=rPG-rfr
    reg rirf r_market

    Is it appropriate to use gen rPG=100*(lnPG-L.lnPG) to generate the return of stock PG from its daily close price?
    *just ignore hml and smb because I just use CAPM not Fama-Fetch three factor model

    Click image for larger version

Name:	Screenshot 2022-11-24 at 12.42.03 PM.png
Views:	1
Size:	235.0 KB
ID:	1690769


    where r_market stands for the return of market portfolio, rfr stands for daily return for the Treasury bills (risk-free rate of return), PG is the adjusted close price of stock PG

    Last edited by Chun Sing Chan; 24 Nov 2022, 05:48.

  • #2
    Chun;
    see -help datetime_business_calendars-.
    Kind regards,
    Carlo
    (Stata 19.0)

    Comment


    • #3
      After looking at the bcal section of the manual, i am still a bit confused which commands should I use to fix this. Can you show the steps that I can do?

      Comment


      • #4
        Chun:
        see -Datetime business calendars creation- entry and related examples, Stata .pdf manual.
        Kind regards,
        Carlo
        (Stata 19.0)

        Comment


        • #5
          I have used the command below to convert %td date in my dataset into %tb date, but it turns out generating all missing values "(8,232 missing values generated)". Why is it happening?

          generate newdate = bofd("simple", date)

          Comment

          Working...
          X