Announcement

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

  • Design of orthogonal arrays in Stata

    Hi everyone,

    I'm trying to run an experiment and need to generate data. The data can be provided by a simulation software while I need to arrange input parameters for the simulation (4 factors) that can vary in 10 levels (I can however do with 8 or at worst with 6 levels). The results of the simulations are going to be used in a Bayesian MCMC-analysis. I wonder if Stata can generate orthogonal arrays for input data for the simulations (4 factors and 10, 8 or 6 levels)

    Best
    Siamak Baradaran

  • #2
    I'm not sure what you mean by an orthogonal array for input data for your simulation. But does something like this fit the bill?

    Code:
    clear*
    set obs 10
    gen int factor1 = _n
    expand 10
    by factor1, sort: gen factor2 = _n
    expand 10
    by factor1 factor2, sort: gen factor3 = _n
    expand 10
    by factor1 factor2 factor3, sort: gen factor4 = _n
    set seed 1234
    gen x = rnormal()

    Comment


    • #3
      Hi Clyde and thank you for your respond. I also wanted to thank you for the code you sent which comes handy in making a random factorial design.

      An orthogonal array, from what I understand, is a set of variables combined so they are orthogonal and the powerful thing about them is that the variable combinations represent main effects. So by generating several sets of arrays orthogonally, one can reduce the number of combinations radically and still be sure to cover main effects, instead of trying all combination of vairables.

      Such arrays for instnat are used in stated preference studies where we cann't ask respondents to many questions (ful factorial combionation of involved variables).

      It seems that it is possible to generate orthogonal arrays in SPSS and SAS and perhaps few other tools to which I don't have access.

      "findit orthogonal"in Stata discovers functions that help orthogonalize variables within a model by replacing the existing variables with orthogonal ones. However I need to generate sets of arrays with orthogonal relation between them .

      best regards
      Siamak
      Last edited by Siamak Baradaran; 21 Apr 2016, 01:57.

      Comment

      Working...
      X