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

Collect information from other variables

$
0
0
Hi!

I have the following dataset:
ID Dummy _weight MatchID SizeRatio
1 1 0 4 5
2 1 0 6 4
3 1 0 6 2
4 0 1
5 0 0
6 0 2
7 0 0
Dummy = public /private

We need a code that can copy the SizeRatio from the public firm to the matched private firm.
The weight tells us how many times the observation has been matched.

The result should look like this:
ID Dummy _weight MatchID SizeRatio
1 1 0 4 5
2 1 0 6 4
3 1 0 6 2
4 0 1 5
5 0 0 0
6 0 2 4
6 0 0 4
7 0 0 0 0

Since we have a weight equal to 2, we need to duplicate that observation (Because wee ned to run a regression later..).

Can someone please help me with the code?

Thanks









1




Viewing all articles
Browse latest Browse all 72790

Trending Articles



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