Announcement

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

  • Error: the panel variable -...- may not be included as an independent variable

    Dear researchers

    I am doing my research with test effects of % ownership of Foreign investor on level of conservatism in period from 2013 to 2015.
    However, after setting xtset for variables -cons and -Shforeign (measured by rate of ownership of foreign investor), I run the Regression random as below. But results from stata is that "Shoreign" may not be included as an independent variable. Please help me review this error. Thanks you so much!

    . xtreg cons Shforei, re
    the panel variable Shforei may not be included as an independent variable

    Could you show me the reason and the way to fix the problem.

    Thanks you so much!

  • #2
    Could you provide a dataexample that replicates your issue? Read the FAQ
    Thank you!

    Comment


    • #3
      Originally posted by William Rossi View Post
      Could you provide a dataexample that replicates your issue? Read the FAQ
      Thank you!
      Dear William Rossi,
      Thanks for your read and answer my issues. Luckily, I found the reasons of the above problems. I don't know how my independent variable Shforie set as a id. I reset Id variable and set is as a new panel variable again. Then, I try "xtreg ..., fe and re" ok.
      Thanks you.

      Comment


      • #4
        Trong:
        However, after setting xtset for variables -cons and -Shforeign (measured by rate of ownership of foreign investor)...
        you cannot -xtset- your dataset as you did.
        The -xtset- command requires -panelid- (mandatory) and -timevar- (facultative).
        However, the lack of -timevar- makes time-series related operators (lags, leads and so on) unvailable, eben though you can still plug -timevar- as a predictor in the righ-hand side of your regression equation.
        Kind regards,
        Carlo
        (Stata 19.0)

        Comment

        Working...
        X