Announcement

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

  • How to create a dyadic data file in long format from data in wide format...?

    Dear all
    first-time user and absolute stata beginner here – I hope my question is appropriate. Using stata I’d like to learn how to construct a dataset that contains all possible pairs of cases. For example, if there are three units of observation a, b, c in an original „wide“ format file I want to form a dataset in a „long“ format that looks like this:
    a b
    a c
    b a
    b c
    c a
    c d
    For each unit of observation, there are also covariates (x1, x2 )in the dataset. Ultimately, this data structure should enable me to compute the difference for the scores of covariate x for each pair of obsersvations. Is there a command in stata to form such a data structure?

  • #2
    You can do that. How to do that depends on the exact structure of the original data. Can you give us an example of that? See help dataex and the FAQ (link in the black bar near the top of this page).
    ---------------------------------
    Maarten L. Buis
    University of Konstanz
    Department of history and sociology
    box 40
    78457 Konstanz
    Germany
    http://www.maartenbuis.nl
    ---------------------------------

    Comment

    Working...
    X