Hi,

I'm quite new to stata and face a problem.
I want to use a for loop to run through my variables and calculate beta's of stocks. For this I intend on using a for loop and a regression to calculate the beta's. I want to generate a variable with these betas. I do not however know how to merge the for and if statement with a regression to generate a variable