Quantcast
Channel: Statalist
Viewing all articles
Browse latest Browse all 72779

Getting values of two Variables in one horizontal line

$
0
0
Dear community,

While i'm currently learning stata's syntax, I'm a bit confused about how to handle the following structure of a dataset:


------|----Group----|----Var_X----|----Var_Y----|

100-|----AA--------|----123-------|----.------------|
101-|----AA--------|------.---------|-----.-----------|
102-|----AA--------|------.---------|----456--------|
103-|----BB--------|-----789------|----.------------|
104-|----BB--------|------.---------|-----.-----------|
105-|----BB--------|------.---------|----101--------|

and so on..

My aim is to do a simple ols regression by using var x as my independent var and var y as my dependent variable.
For this reason, I need to get both variables of each group into one line, probably looking like this:


xxx-|----AA--------|----123-------|----456-------|


xxx-|----BB--------|----789-------|----101-------|



As I have a huge amount of observations, it would be impossible to to this manually, so i would like to ask you guys how to
automate this procedure?

Thank you very much!
&
Kind regards

Georg

Viewing all articles
Browse latest Browse all 72779

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>