Announcement

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

  • question about polychoric correlations and matrix not positive semidefinite



    Now I have 14 variables (7 of them are binary and the other 7 are ordinal) and I want to conduct CFA and SEM analysis, but none of my variables are continuous, so I think it's better to compute the polychoric correlation first, and then use the polychoric matrix to do the CFA and SEM. So I tried the following code in Stata:

    local thevars ..."list of variables goes here"...

    polychoric `thevars'
    mat polychR = r(R)

    forvalues i=1/`: word count `thevars' ' {
    forvalues j=1/`i' {
    local setcor `setcor' `=polychR[`i',`j']'
    }
    if `i' < `: word count `thevars' ' local setcor `setcor' \
    }

    local N = _N
    clear
    ssd init `thevars'
    ssd set obs `N'
    ssd set cor `setcor'

    However, Stata keeps giving this error:

    matrix not positive semidefinite One or more numeric values are incorrect because real data can generate only positive semidefinite covariance or correlation matrices. r(459);

    So my question is, in order to do SEM, how to fix this "not positive semidefinite" matrix and feed this polychoric correlation matrix into Stata by "ssd" syntax? If the Stata code can be provided, that'll be very much appreciated.

    Thanks.

  • #2
    Cross-posted at http://stackoverflow.com/questions/4...e-semidefinite

    Please note our explicit policy on cross-posting spelled out in the FAQ Advice everyone is asked to read before posting:

    http://www.statalist.org/forums/help#crossposting

    8. May I cross-post to other forums?

    People posting on Statalist may also post the same question on other listservers or in web forums. There is absolutely no rule against doing that.

    But if you do post elsewhere, we ask that you provide cross-references in URL form to searchable archives. That way, people interested in your question can quickly check what has been said elsewhere and avoid posting similar comments. Being open about cross-posting saves everyone time.

    If your question was answered well elsewhere, please post a cross-reference to that answer on Statalist.

    Comment


    • #3
      If you're interested in CFA or SEM, then why not just use gsem and skip the polychoric correlation matrix altogether?

      Comment


      • #4
        Originally posted by Nick Cox View Post
        Cross-posted at http://stackoverflow.com/questions/4...e-semidefinite

        Please note our explicit policy on cross-posting spelled out in the FAQ Advice everyone is asked to read before posting:

        http://www.statalist.org/forums/help#crossposting
        Sorry about that. I didn't know that we should tell people about the cross-posted. I hereby claim that I also post this question on http://stackoverflow.com/questions/4...e-semidefinite. So get back to the question itself, and solid suggestions?

        Comment


        • #5
          Originally posted by Joseph Coveney View Post
          If you're interested in CFA or SEM, then why not just use gsem and skip the polychoric correlation matrix altogether?
          Thanks for the advice. Gsem is a very good suggestion, but the problem is, we can't conduct the goodness-of-fit test like "estat gof, stats (all)" after gsem. So how can we know whether the model is a good fit or not?

          Comment


          • #6
            Hello Qian,

            Unfortunately, you didn't give much detail on the questionnaire, and the range of the ordinal questions.

            For the binary questions, there are questionnaires whose authors recommend to count the number of positive questions, for example. For the ordinal questions, and depending on the questionaire, you may use the mean value according to the "dimensions", as usually is proposed by the authors of some questionnaire.

            That said, for the ordinal variables, sometimes a "robust" vce may do the trick, but you will face "less" GOF parameters in the output.

            These general aspects being underlined, I gather you shall preferrably focus on the causes of a non-positive-definite matrix. They should come to the spotlight, more than the GOF tests.

            To name a few issues: when the sample is small. when there less than two indicators per factor; presence of outliers; too many free parameters; severe depart from normality; underidentified model; mispecified model, etc.

            Finally, IMHO, I believe that, provided a model is correctly specified (in the particularities, or "individual" level) and takes in consideration the rationale as well as the patterns of distribution of the variables, the very fact that gsem won't present (global) GOF tests - by the way, theoretically speaking, most of them may be considered "non applicable" under these terms - may not be a crucial issue.

            Hopefully that helps.

            Best,

            Marcos
            Last edited by Marcos Almeida; 21 Dec 2016, 09:13.
            Best regards,

            Marcos

            Comment


            • #7
              Originally posted by Qian Wei View Post

              Thanks for the advice. Gsem is a very good suggestion, but the problem is, we can't conduct the goodness-of-fit test like "estat gof, stats (all)" after gsem. So how can we know whether the model is a good fit or not?
              On your way to fitting a model with sem, you get a nonpositive-definite polychoric correlation matrix. Let's say that you're able to cajole the polychoric correlation matrix into a positive semidefinite matrix somehow and proceed to sem. Just what would a goodness-of-fit test result mean in that case? Your model's fit has already flunked the test at the pre-processing stage.

              I wouldn't worry too much about not being able to conduct goodness-of-fit test with gsem.

              Comment


              • #8
                Originally posted by Joseph Coveney View Post

                On your way to fitting a model with sem, you get a nonpositive-definite polychoric correlation matrix. Let's say that you're able to cajole the polychoric correlation matrix into a positive semidefinite matrix somehow and proceed to sem. Just what would a goodness-of-fit test result mean in that case? Your model's fit has already flunked the test at the pre-processing stage.

                I wouldn't worry too much about not being able to conduct goodness-of-fit test with gsem.
                This makes so much sense. Thank you Joseph! You are so helpful.

                Comment

                Working...
                X