Announcement

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

  • Simulations using Stata?

    Hello Stata people;

    I do have a question that could look a bit wrong or weird, but I'm going to ask it anyway and see if it is possible to get answers. I don't know if this question was already asked before, but, is it possible to do simulations using Stata? By simulation, I do mean that, for instance, when one creates a variable by generating it from an other variable or something like that, is it possible to have that relation or that link between the two variables in an active dynamic mode? By active mode, I mean that if one changes the first variable, the second variable that's linked to it or generated from it would change aswell... Is it possible to have simulation scenarios using Stata?

    Is it possible to do such work in Stata?

    With many thanks.

  • #2
    Simulations are absolutely possible, yes. Statistical propelling languages would not be very useful if they couldn’t do this.

    But, the method you have described is not possible, in that if you want to update variable definitions, you have to explicitly tell Stata to do that. The good news is that you probably don’t need to design a simulation like that though.

    Comment


    • #3
      You would generate the second variable using a formula that depended on the first variable. An iteration of your simulation would probably happen in a loop (e.g. a forvalues loop). By putting the command that generates the second variable within that loop, you would cause that variable's values to change based on the changed values of the first variable in each iteration of the loop.

      Comment


      • #4
        Leonardo Guizzetti Thanks for the answer! Although, I guess I didn't make myself clear... I was talking more about simulations on the database itself (like on Excel), because I've used a dataset on Stata to generate some variables about revenu and consumption of a group of people (and you know, consumption depends on Revenu), and I've studied the distribution of consumption by revenu categories (you know, from the poorest 10% to the richest 10%), and I've constructed a table which shows the average consumtion by level of revenu for each social group... And now, what I want to do on that table is actually play on the revenus of the social groups and see how their consumption changes...

        I don't know if that's possible to do on Stata, or maybe if it is possible to export the result table on another format so that could be possible.

        With Thanks!

        Comment


        • #5
          Hemanshu Kumar Thanks for the respond! Actually, I didn't mean a forvalues loop, I was talking more about a simulation on the dataset itself.

          Comment


          • #6
            Originally posted by Aziz Essouaied View Post
            Leonardo Guizzetti Thanks for the answer! Although, I guess I didn't make myself clear... I was talking more about simulations on the database itself (like on Excel), because I've used a dataset on Stata to generate some variables about revenu and consumption of a group of people (and you know, consumption depends on Revenu), and I've studied the distribution of consumption by revenu categories (you know, from the poorest 10% to the richest 10%), and I've constructed a table which shows the average consumtion by level of revenu for each social group... And now, what I want to do on that table is actually play on the revenus of the social groups and see how their consumption changes...

            I don't know if that's possible to do on Stata, or maybe if it is possible to export the result table on another format so that could be possible.

            With Thanks!
            Well, I don't see why this cannot be done in Stata, but then again, there's very little detail here in a concrete sense of what it wanted and I'm not an economist. This is much different from the types of simulations I normally do so I don't have an immediate example to show you.

            Comment


            • #7
              Maybe this is what you are looking for: https://maartenbuis.nl/presentations/konstanz11.pdf
              ---------------------------------
              Maarten L. Buis
              University of Konstanz
              Department of history and sociology
              box 40
              78457 Konstanz
              Germany
              http://www.maartenbuis.nl
              ---------------------------------

              Comment

              Working...
              X