Announcement

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

  • Blank output after using xtcsd for the pesaran cd test for cross sectional dependence

    Hello all,

    I've searched the web the answers and at this point, this feels like my last result. I have panel data with 16 time points and 800 observations for a dozen variables for 50 states (N=784 for one of the variables as there are no observations for one of the states for the entire time period. e.g. Nebraska is a unicameral therefore for one of my control variables, partisan control, Nebraska cannot be calculated). I am attempting to test for cross sectional dependence using the Pesaran CD test. Because I have time invariant variables, I used a random effects to get the residuals. Here is the code I used below:


    foreach Supportiveness in N_components support {
    xtreg `Supportiveness' `Race_R_factors' ///
    `Political_F' `Economic_F' `Social_F', re
    }

    Following this I ran the following code:

    xtcsd, pesaran

    My output came out blank like this:

    Pesaran's test of cross sectional independence = ., Pr = .


    No values. I have no clue what to do from here. Please if you can offer any advice, please let me know. I also tried running the xtcsd, pesaran ab and I got a an error message below:


    [P] error . . . . . . . . . . . . . . . . . . . . . . . . Return code 198
    invalid syntax
    option __________ incorrectly specified
    option __________ not allowed
    __________ invalid
    range invalid
    __________ invalid obs no
    invalid filename
    __________ invalid varname
    __________ invalid name
    multiple by's not allowed
    __________ found where number expected
    on or off required
    All items in this list indicate invalid syntax. These errors
    are often, but not always, due to typographical errors. Stata
    attempts to provide you with as much information as it can.
    Review the syntax diagram for the designated command.

    In giving the message "invalid syntax", Stata is not helpful.
    Errors in specifying expressions often result in this message.

    (end of search)


  • #2
    Jennifer:
    welcome to this forum.
    I'm not clear with the goal of your loop.
    I'm under the impression that it repeats -xtreg,re- for each state separately.
    If that were the case, Stata should have thrown the following error message:
    Code:
    insufficient observations
    r(2001);
    as -re- specification needs at least two panels to return coefficients.

    The best fix that crosses my mind is to go -xtreg,re- on a limited subsample of states (say, three) without looping over the whole dataset.
    Then you can see whether the issue depends on the loop or else.
    Kind regards,
    Carlo
    (Stata 19.0)

    Comment

    Working...
    X