Summary(ols_fixed)$coefficients # Estimate Std. Ols_fixed = lm(sales ~ price_adj + pop + pop16 + income_adj +factor(year) + factor(state), data = Cigar) # Fixed effects using Least squares dummy variable model But for convenience, we only show the estimated coefficients of independent variables and first five estimated effects for years. In fact, the summary of lm will show individual fixed effects estimates for every year and every state. # Residual standard error: 26 on 1375 degrees of freedom # lm(formula = sales ~ price_adj + pop + pop16 + income_adj, data = Cigar) Ols = lm(sales ~ price_adj + pop + pop16 + income_adj, data = Cigar) Fit an OLS regression model with sale as the response and price_adj, pop, pop16 and income_adj as predictors: # Run ordinary linear regression without fixed effect
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |