Announcement

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

  • #16
    Originally posted by Clyde Schechter View Post
    So it appears in your data that _n1 is sometimes missing, but that values of _n1 can be linked to more than one value of _id. By contrast, _id is never missing, and no value of _id is ever duplicated. Relying on this assumption being true throughout your data:

    Code:
    * Example generated by -dataex-. To install: ssc install dataex
    clear
    input int(_id _n1)
    25 78
    46 78
    95 86
    34 89
    12 92
    26 41
    78 .
    86 .
    89 .
    92 .
    41 .
    32 51
    51 .
    end
    
    isid _id // VERIFY ASSUMPTION
    
    drop if missing(_n1)
    by _n1 (_id), sort: gen _j = _n
    reshape wide _id, i(_n1) j(_j)
    isid _n1
    gen long tuple_id = _n
    rename _n1 _id0
    reshape long _id, i(tuple_id) j(_j)
    drop if missing(_id)
    drop _j
    sort _id
    order _id, first
    should do it.
    Hi Clyde, can you help me to use your method after a psmatch2 with neighbor (3)? I don't know how to create the variable "tuple_id" in this case. I need it,to do a DID analysis on pairing.

    Comment


    • #17

      dear Mia Pham I'm trying to learn about using the psm technique. The data link that you shared appears to be broken. Could you share the dataset, if that's not a problem? I'll be grateful. Thank you in advance

      Comment


      • #18
        Dear all,
        getting back into the topic again, I was wondering: Do we need to use weights in the mixed effects model, if we have matched 1-to-many? And if so what kind of weight (fweight, pweight,...)?

        Many thanks in advance!

        Comment


        • #19
          The question posed in #18 is not clearly related to the original topic of this thread. Because these threads are not merely dialogs between questioners and responders, and other people search this Forum looking for already-existing answers to their questions, and still others come and browse topics of interest, it is important to keep them on topic.

          So I suggest reposting this question as a New Topic. When doing that, I would also suggest that you provide more information about the actual context here. What are the data sets involved, and why did they have to be 1:m merged? How will the variables from each data set enter into the analysis? And are the data such that any weights would have been necessary for analyses using only one of the data sets?

          Comment


          • #20
            Sorry for stating my question in a confusing way. As I don't refer to merging datasets, but matching variables, let me first restate the question here with more information and clarity. If afterwards, you still think this is unrelated I will start a new thread.

            I use only 1 dataset with cross-sectional data. I want to asses the effect of a treatment A, on some variables Y. A number of variables X affects both, the likelihood of being in the treatment group (A=1) and the outcome variables Y. I have thus used Mahalanobis matching to form groups, that are fairly alike with regards to X. Some treatment observations have been matched to more than 1 control observation (or vice-versa), so psmatch2 gives these observations a weight>1. My data look as follows:

            _treated _support _weight _id _n1 _nn block
            Treated On support 1 552 1 1 1
            Untreated On support 1 1 . 0 1
            Untreated On support 1 2 . 0 2
            Treated On support 1 560 2 1 2
            Treated On support 1 559 8 1 8
            Untreated On support 2 8 . 0 8
            Treated On support 1 565 8 1 8


            Based on these blocks, I want to do a mixed model:

            mixed Y treatment covariates || block:

            I have the option to specify a fweight or a pweight, for this model, but I am unsure, whether this is necessary. For example, I could command:

            mixed Y treatment covariates [pweight=_weight] || block:

            (fweight seems unsuited, as it increases the number of observations used.)

            Comment


            • #21
              I would not use weights in this analysis at all. The original data were an ordinary sample, and the arrangements of the matching don't alter that.

              Comment


              • #22
                Hi Clyde,
                In reference to #2, I would really appreciate if you could suggest how could go about addressing the following.
                I have firm-pairs to match from. For each firm-pair I would match them based on covariates (x1, x2...) and my covariates would be firm characteristics like size, profit etc.. I would want to run the regression Y x1 x2 x3 only after I have my matched firm-pair with me (based on propensity score of any other distance. There is an additional restriction requirement that one firm cannot have more than one match, unless there is a tie.

                Put differently, I would first want to have matched pair of firms, and only then would I want to run regression. I know there is a way to obtain this through psmatch2. However this needs specifying my Y in the command to begin with which is something I want in the second stage. I hope I make sense.
                Thank you,
                D Vikas
                Last edited by Dev Vikas; 13 Jan 2022, 12:44.

                Comment

                Working...
                X