Dear Stata users,
I am new to Stata and currently doing a linear regression for a continuous dependant variable, 3 continuous covariates and 2 categorical covariates.
I have first tried the following code, while country and industry are the already encoded categorical variables. In this form, the different categories of country and industry are taken as continuous variables, however.
Then I tried factor variables by adding the "i." for country and industry. Moreover, I've included the margin-code to get the respective effects for country and industry. The code then looked like this:
The margin data now gave me the coefficients and significance levels for the different countries and industries accurately. However, the other three factors are still depending on the base level I take for the two category values. Is there any possibility to get unbiased coefficients? Or what would be the best-practices in such cases to receive the other three factors largely unbiased?
Sorry if this sounds like a dumb question to you. I've already tried searching through the forum, however, I couldn't find a solution that fit precisely to my problem.
Best regards,
Alex
I am new to Stata and currently doing a linear regression for a continuous dependant variable, 3 continuous covariates and 2 categorical covariates.
I have first tried the following code, while country and industry are the already encoded categorical variables. In this form, the different categories of country and industry are taken as continuous variables, however.
Code:
regress return date country industry revenues employees
Code:
regress return date i.country i.industry revenues employees margin i.country i.industry
Sorry if this sounds like a dumb question to you. I've already tried searching through the forum, however, I couldn't find a solution that fit precisely to my problem.
Best regards,
Alex
Comment