Announcement

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

  • correlation between attributes

    Hi statalist,

    I am using -mixlogit- and -gmnl- to model a DCE experiment.
    In one of the models, I allow two variables ("income in the public sector" - a continuous variable - and "opportunities to work in the private sector" - a dummy variable that equals 1 for "frequent") to be correlated.
    I ran the "mixlcov" command for obtaining the covariance-variance components (in annex).
    How can I calculate the rho between the two variables based on the values of v11,v21,v22 ?

    Thank you for you kind help
    Best Regards
    Pedro


    Attached Files

  • #2
    Plz bump

    Comment


    • #3
      I think you have not gotten any replies because your question is obscure.

      You refer to three commands, -mixlogit-, -gmnl-, and -mixlcov-, none of which is part of official Stata. So presumably these are user-written commands--you don't even tell us where they came from--that only a fraction of forum members will know about. (As for me, I am somewhat familiar with, but do not myself use, -mixlogit-, and I have never heard of the other two.)

      The contextual information you provide is that this is to simulate a DCE experiment--an abbreviation that means nothing to me and, I suspect, to many others. And then you post a picture attachment--some of us don't feel comfortable accessing attachments posted by strangers, as they may contain malicious content. Finally, your post title, correlation between attributes, though it appears to summarize what you want, really doesn't begin to indicate what your post is really about.

      In short, I think you may have better luck if you explain your situation more clearly and give a better indication of what those three programs are, and a more fully descriptive post title. To show the output you want people to study, paste it from Stata's results window, or your log, into a code block--that raises no safety concerns and is also guaranteed to be readable. If you don't know how to create a code block on this Forum, please see the FAQ.
      Last edited by Clyde Schechter; 05 May 2015, 19:21.

      Comment


      • #4
        Dear Clyde,

        That is completely true. I was lazy and I apologise for that.
        Just to start by some of your considerations : -mixlogit- and -mixlcov- are unofficial commands written by Anne Rise Hole and -gmnl- was written by Gu, Hole and Know. These are commands that allow us to estimate variations from the logit, namely the mixed logit (allows preference heterogeneity) and the generalised multinomial logit (allows preference and scale het.)
        A DCE is a discrete choice experiment: in a DCE , the respondent is asked to choose between two alternatives that are characterised by attributes and different levels of those attributes. So, e.g., you can ask a consumer to choose between product A and B, where product A costs 50USD and the service is "Average", and Product B costs 100USD and the service is "Good". You use a logit - or the aforementioned variations - to estimate the impact of each attribute (and level) on the consumers' choice.

        For the simplest case,
        I am running a model where I ask respondents to choose between Job A and B, both of which have the following attributes: "Income" and "Opportunities to work in the private sector". Probably, those attributes are correlated, since you are willing to accept a job with lower income if it allows higher opportunities in the private sector, and vice-versa. Arguably, the logit will give you each of the attributes' impact on the consumers' choice.

        The -mixlcov- is a variation from the -mixlogit - that gives the variance-covariance matrix estimated from the mixed logit model and the correlation between them.
        I've had some difficulties in estimating the output from this command

        The code I used:

        Code:
        global randvars "INCOME PRIVATE"
        
        mixlogit ESCOLHA, rand($randvars) group(GID) id(ID) nrep(50) corr
        
        mixlcov
        The following output

        Click image for larger version

Name:	mixlcov.png
Views:	2
Size:	20.9 KB
ID:	1293528

        What exactly does the v22 est.sig. result mean?

        Thanks a lot for any help you may give me and sorry for the 'sloppy' post...

        BR
        PEdro



        Comment


        • #5
          v22 is the estimate of the variance of your second predictor's coefficient. The statistical significance says that the precision of that estimate is sufficiently tight the data are probabilistically incompatible with the null hypothesis that that variance is actually 0.

          Since variances are necessarily non-negative, and zero variances are unusual in the first place, this hypothesis test may be of little or no interest. (Sometimes one is interested in knowing whether a variance component at some level in a hierarchical linear model is zero or not, and in that case the similar statistics presented in that kind of output is relevant--though it is usually better to test that by likelihood ratio anyway. It is hard for me to think of a situation, however, where one would really want to test whether the variance of a regression coefficient is significantly different from zero.)

          Comment


          • #6
            Clyde,

            Thanks a lot for your explanation.
            I calculated rho as follows:
            rho = _b[v21] / sqrt (_b[v11] * _b[v22])

            and that gave me an unnusually high negative correlation
            Click image for larger version

Name:	Captura de ecrã 2015-05-8, às 20.38.32.png
Views:	1
Size:	15.4 KB
ID:	1293676



            here's my code:

            Code:
            nlcom ([l21]_b[_cons]*[l11]_b[_cons]) / sqrt([l11]_b[_cons]*[l11]_b[_cons] * ([l21]_b[_cons]*[l21]_b[_cons] + [l22]_b[_cons]*[l22]_b[_cons]))
            Note: [l11], [21] and [l22] , "the estimated parameters are the means of the coefficients plus the elements of the elements of the lower triangular matrix L, where the covariance matrix for the random coefficients is given by V=LL'


            I'm sure there's something I'm not seeing here..

            Thanks a lot
            Pedro

            Comment


            • #7
              This is not quite related, but out of curiosity: In a discrete choice experiment situation what happens when the attributes are conflated with each other from the respondent side? i.e. Respondents have V1, V2, and V3, but in fact both V1 and V2 are influenced by V3. How does the analysis proceed other than saying results are conflated and V3 is the confounding variable?

              Comment

              Working...
              X