Announcement

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

  • Command xtabond2 gives error message: factor variables may not contain noninteger values

    Hello. I am trying to run the xtabond2 command in Stata 14 and I have encountered a problem that I could not solve using the solutions in previous posts on the matter. I am trying to apply the system GMM estimators in a panel VAR model. I am trying to assess the impact of investor sentiment obtained from social media (values ranging from [-1] to [1] on stock returns (expressed in decimals) and trading volume (absolute numbers). Below is my proposed command for the equation for the return variable.

    Code:
    xtabond2 return 1.return sentiment, gmm (sentiment, lag(2 2) collapse) small nonconst
    Where:
    • return is the daily stock returns for the sample companies
    • sentiment is the value for tweet sentiment regarding the company (values -1 to 1)
    • gmm estimates the variable that I believe might be exogenous
    I will later run a second regression replacing return with volume. I use collapse as my instruments widely exceeds my groups (9 groups, 174 instruments). I use small because the sample is small and i want to interpret t-statistics.

    When I try to run the command, i get the following error message: factor variables may not contain noninteger values. I believe this means I have to convert the variable to a continuous variable, but I am unsure wether that is a good solution, and I also do not know how to execute such a commando. Does anyone have an idea on how to resolve this error message? Any help is greatly appreciated! Hjalmar

  • #2
    I think you wrote 1.return while you should have L.return. You want the lagged values of return don't you? In addition I would also use some lagged values of returns as instruments.

    Also it might be preferable to use a two-step estimators (option twos).

    ​​​Finally I do not think you are estimating a panel VAR model. This is just a dynamic panel data model.
    ​​​​
    ​​​​​​
    Last edited by Dario Maimone Ansaldo Patti; 14 Aug 2018, 19:03.

    Comment


    • #3
      Originally posted by dmaimone View Post
      I think you wrote 1.return while you should have L.return. You want the lagged values of return don't you? In addition I would also use some lagged values of returns as instruments.

      Also it might be preferable to use a two-step estimators (option twos).

      ​​​Finally I do not think you are estimating a panel VAR model. This is just a dynamic panel data model.
      ​​​​
      ​​​​​​

      You are correct, thank for your help dmaimone!

      Comment

      Working...
      X