Announcement

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

  • Wilks lambdas of variables in discriminant analysis

    Hi, statalisters.

    Along with a set of continuous variables (ca1, ca2, ca3, caa4, l1, l2, l3, l6, and l8), my dataset includes a categorical variable (cluster) that divides the sample intro three categories (1, 2 and 3). Using discriminant analysis, I want to check whether the observations in the categories of the variable 'cluster' differ significantlly from each other.

    To obtain global and pairwise F-statistics (and eigenvalues, i.e., Wilks' overall lambdas), I use the following command:

    Code:
    candisc ca1 ca2 ca3 caa4 cl1 cl2 cl3 cl6 cl8, group(cluster)
    However, I would also need to obtain Wilks lambdas of variables, but I have not been able to discover whether this can be done with Stata.

    Can someone let me know whether these lambdas can be computed and, if s/he were so kind, how?

    Thank you in advance.

  • #2
    I think the column called Likelihood Ratio are your Wilks lambdas.

    The Wilks lambda is the likelihood ratio statistic for a particular linear hypothesis in multivariate analysis.

    Comment


    • #3
      Thank you very much, Joro, for your answer.

      I agree with you: the (overall) Wilks lambda is equal to the likelihood ratio stastitic (I made a mistake in my first post: I wrote 'eigenvalues' where I should have written 'likelihood ratio'; I am sorry about that).

      However, my question is a different one: I would like to know (i) whether there is something like Wilks lambdas for variables (i.e., a Wilks lambda per variable), and (ii) if the answer is yes, how they can tbe calculated.

      The reason why I want to know this is because a referee is asking me to include these lambdas in the revision of a paper.

      I have seen that something similar to lambdas for variables can be calculated with SPSS, but I have no clue about whether or how this can be done with Stata.

      Thank you very much in advance.

      Comment


      • #4
        Originally posted by Miguel A. Duran View Post
        I would like to know (i) whether there is something like Wilks lambdas for variables (i.e., a Wilks lambda per variable), and (ii) if the answer is yes, how they can tbe calculated.

        . . . I have seen that something similar to lambdas for variables can be calculated with SPSS, but I have no clue about whether or how this can be done with Stata.
        Well, given its definition, for a per-variable lambda, how about something along the following lines?
        Code:
        version 17.0
        
        clear *
        
        import spss using ///
            "https://stats.idre.ucla.edu/wp-content/uploads/2016/02/discrim.sav"
        
        // Omnibus
        candisc outdoor social conservative, group(job) notable nocoef nostruct nomeans
        
        // Per-variable
        foreach var of varlist outdoor-conservative {
        
            display in smcl as result _newline(2) "`var'"
        
            // One way
            candisc `var', group(job) notable nocoef nostruct nomeans
        
            // Another way (look at the first row, labeled "W")
            manova `var' = job
        
            // And another way
            anova `var' job
        
            // And yet another way
            quietly regress `var' i.job
            testparm i.job
        }
        
        exit
        Dataset from here.

        Comment


        • #5
          Thank you, Joseph. Your proposal has been very useful and clarifying. At the end of the day, what you propose is computing the Wilks lambda of, e.g., variable ca1 as if the latter were the unique predictor variable. Then, if I am not misaken, using plain standard canonical discriminant functon coefficients would be better: I think that they are more more informative.

          Just in case someone would need additional information, the following sites, along with the one that you mention, could be helpful regarding discrimant analysis:

          https://stats.oarc.ucla.edu/stata/da...tion-analysis/

          https://stats.oarc.ucla.edu/stata/ou...nant-analysis/

          Comment


          • #6
            I have found that Wilks lambdas for variables can be obtained from tests of equality of group means (i.e, one-way ANOVA).

            I have seen that SPSS provides these results (https://www.ibm.com/docs/en/spss-sta...ty-group-means), but I have not found how to do something similar with Stata.

            Does someone know how to do it with Stata?

            Thanks in advance.

            Comment


            • #7
              Originally posted by Miguel A. Duran View Post
              I have found that Wilks lambdas for variables can be obtained from tests of equality of group means (i.e, one-way ANOVA).

              I have seen that SPSS provides these results. . . , but I have not found how to do something similar with Stata.

              Does someone know how to do it with Stata?
              Didn't you run the code that I posted above in #4? I showed you there exactly how to do this in Stata.

              The first two methods' output will show the Wilks lambda, and those two as well as all the other methods there will show the corresponding the F test statistic.

              Comment


              • #8
                Thank you again, Joseph. I got a bit messed up.

                This option that you propose does exactaly what I need (i.e., it provides Wilks lambdas for variables, along with other statistics, in tests of equality of group means):


                Code:
                use https://stats.idre.ucla.edu/stat/stata/dae/discrim, clear
                
                foreach var of varlist outdoor-conservative {
                display in smcl as result _newline(2) "`var'
                manova `var' = job
                }

                Comment

                Working...
                X