Announcement

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

  • #16
    Thank you very much for answering.
    It is because I have three main independent variables that I would like to shuffle. I observe the behaviour of each x1 x2 and x3. Each measure of x1 x2 x3 varies per city. I want to see if I shuffle the cities and hence the measures each id will be exposed to, if this permute will give me p-values indicating that 95% my real values are larger than the 'fake' models with the shuffled x1 x2 x3 measures. . x1 corresponds to measures from period 1, x2 for period 2 and x3 measures from period3. The three of them are my main explanatory variables. That's why I thought I should permute x1 x2 and x3.
    Many thanks.

    Comment


    • #17
      Mike Lacy thank you very much. In your code:
      Code:
        
       prog mypermute, rclass shufflevar foreign rep78 reg headroom foreign_shuffled rep78_shuffled weight return scalar t=_b[foreign]/_se[foreign drop *shuffled end
      Should the line return scalar be?
      Code:
      return scalar t=_b[foreign_shuffled]/_se[foreign_shuffled]
      I have tried to do so to my dataset and then simulate mypermute using
      Code:
      simulate t=_b[foreign_shuffled]/_se[foreign_shuffled], cluster(city) reps(100) saving(my simulation):mypermute
      But I get the my simulation file with all the 100 t = 0.
      When I run the code also using my data
      Code:
      reg headroom foreign_shuffled rep78_shuffled weight
      alone and see the results, the coefficients of foreign_shuffled rep78_shuffled in my dataset are all zero.

      Do you have any advice for that, please?
      Many thanks.

      Comment


      • #18
        Yes, Juliana, sorry for my mistake, you do want
        Code:
        t=_b[foreign_shuffled]/_se[foreign_shuffled]
        However, the code you show for -simulate- looks impossible to me, as -help simulate- does not show any -cluster- option.

        I'm sorry, but I don't understand what you mean at #16. Perhaps someone else will step in here, but I think I've gone as far as I can go.

        I think you need to speak with some local colleague to be sure about what kind of assumptions you want your randomization approach to implement, and then come back and post your question under a new and relevant thread. In doing so, you'd so well to show a data example with -dataex-.

        Comment


        • #19
          Mike Lacy Hi, Thank you very much for answering. Sorry, I wrote cluster, but I did not include it when I ran the simulate.
          I will follow you advice then.
          Thank you so much indeed.

          Comment

          Working...
          X