Announcement

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

  • xtset with a string variable for quarterly time

    Hi,
    gvkey is the id of the firm and i downloaded a column datafqtr from the database that has the following format 2002q1,2002q2 etc... where the first 4 digits are for the year and q1,q2 etc... represents the quarter
    HTML Code:
     xtset gvkey datafqtr, quarterly
    is giving me the following error
    string variables not allowed in varlist;
    datafqtr is a string variable
    r(109);
    How can i set datafqtr as the time variable in my regressions?

  • #2
    You need a numerical time variable.

    Code:
    gen quarter= quarterly(datafqtr, "yq")
    format quarter %tq
    xtset gvkey quarter
    All discussed in

    Code:
    help datetime

    Comment

    Working...
    X