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?
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?
Comment