Announcement

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

  • Getting error message when corr(unstructured) is in the model

    Hi everyone,

    After running
    Code:
    xtset SurveyID_code
    xtgee DLP kVp , corr(unstructured) vce(robust)
    I got "must specify timevar; use xtset" error message.

    When I changed correlation structure to
    Code:
    xtset SurveyID_code
    xtgee DLP kVp , corr(independent) vce(robust)
    or
    Code:
    xtset SurveyID_code
    xtgee DLP kVp , corr(exchangable) vce(robust)
    it ran perfectly.

    Any suggestions why this happened?

    Cheers,

  • #2
    In order to have an unstructured correlation matrix, Stata needs to know which observation in each SurveyID_code group corresponds to which observation in every other SurveyID_code group so it can match them up properly. By contrast, for exchangable or independent correlation that information is not needed because all of the observations contribute to that structure symmetrically.

    It follow, that the -xtset- command must have a time variable specified in order to use unstructured correlation. (The same is also true for autoregressive correlation). The error message itself means exactly what it says. The solution is to specify the time variable in your -xtset- command.
    Last edited by Clyde Schechter; 13 Jun 2017, 21:43.

    Comment

    Working...
    X