Dear Stata experts,

I'm new to stata and need some help for my analysis. This is my problem:

I have a dataset with many companies and their peer groups (consisting of other companies) for the years 2014-2016.

There is also another dataset with share price returns for a longer period for all those companies.

I need for any company and year (2014-2016) a multiple linear regression.

For example company Apple has in 2014 a peer group consisting of the companies Alphabet, Microsoft and Facebook.

I need the beta coefficients for each of the peer companies on the share price returns for the five years befor 2014.

Return

So I face different problems at the moment:

- multiple linear regression with

- linking/merging two (big) datasets (each company can be identified by an unique Id in both datasets)

- incorporating only the share price return of the last five years (range of t not constant)

I hope the description of the problem is ok.

Thank you very much for your help,

Freddy

I'm new to stata and need some help for my analysis. This is my problem:

I have a dataset with many companies and their peer groups (consisting of other companies) for the years 2014-2016.

There is also another dataset with share price returns for a longer period for all those companies.

I need for any company and year (2014-2016) a multiple linear regression.

For example company Apple has in 2014 a peer group consisting of the companies Alphabet, Microsoft and Facebook.

I need the beta coefficients for each of the peer companies on the share price returns for the five years befor 2014.

Return

_{ Apple, t}= β_{0}+ β_{1}*Return_{ Alphabet, t}+ β_{2}*Return_{ Microsoft, t}+ β_{3}*Return_{ Facebook, t}; t ranges from 2009-2013So I face different problems at the moment:

- multiple linear regression with

__different__number of independent variables- linking/merging two (big) datasets (each company can be identified by an unique Id in both datasets)

- incorporating only the share price return of the last five years (range of t not constant)

I hope the description of the problem is ok.

Thank you very much for your help,

Freddy

## Comment