Announcement

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

  • Factor analysis of mixed variables

    Hi. I used principle component analysis to compute factor scores for a set of variables that include both continuous and dummy/categorical variables. A referee wants me to use factor analysis for mixed variables (FAMD in R). Can anyone please point me to a similar package in Stata? I would rather not switch to learning R at such short turnaround! Thanks so much. Anyone will be truly appreciated.

  • #2
    Well. ChatGPT to the rescue! It seems it's possible. Posting the response here for others who might find this useful:

    Stata can handle mixed variables in factory analysis. However, the appropriate method to use will depend on the type of variables you have.

    If your mixed variables consist of both continuous and categorical variables, you can use factor analysis with principal component analysis (PCA) as the extraction method. Stata's "factor" command can perform this type of analysis.

    Here is an example syntax for conducting a factor analysis with PCA extraction for mixed variables:
    bashCopy code
    factor var1 var2 var3 var4 var5, pca

    If your mixed variables consist only of categorical variables, you may want to consider using factor analysis with a categorical data handling method, such as principal axis factoring (PAF) or maximum likelihood estimation (MLE). Stata's "factormine" command can perform this type of analysis.

    Here is an example syntax for conducting a factor analysis with PAF extraction for categorical variables:
    Copy code
    factormine var1 var2 var3 var4 var5, paf

    Now, where do I find the user-written factormine? It seems to have disappeared!
    Last edited by Peter Suntan; 18 Apr 2023, 14:46.

    Comment


    • #3
      I tried:
      factor var1 var2 var3 var4 var5, pca

      It said "pca not allowed"

      Comment


      • #4
        Code:
        help pca

        Comment


        • #5
          I didn't look at this thread when it started as the topic is not of great interest to me.

          But in order that too many people don't waste too much of their time given #2, I will confirm that the factormine command in Stata can't be found. I suggest that it never existed and that it's a confection of ChatGPT -- and I don't have to explain how ChatGPT came up with it, but perhaps by mixing in material on the quite different FactoMineR https://www.rdocumentation.org/packa...R/versions/2.8.

          =3 is I guess a simpler matter of missing that pcf not pca is an option of factor, as is documented in the help, although as I think #4 is implying if you really want principal component analysis, go straight to pca.

          It is banal but basic that while ChatGPT and its cousins may appear to know much more about Stata than you do, their "know" is different from the "know" of people. I await stories of puzzled reviews of weird or confused analyses in problematic papers when enquiry culminates in "I found the code using ChatGPT".

          Comment


          • #6
            I will no longer support efforts of people coming here or elsewhere with code suggested by any LLM. It flags to me the person seeking help is either clueless or lazy, and has made no real effort to teach themselves or research the topic themselves.

            Comment

            Working...
            X