The p-value for the dummy variable sexMale is very significant, suggesting that there is a statistical evidence of a difference in average salary between the genders. # (Intercept) 101002 4809 21.00 2.68e-66įrom the output above, the average salary for female is estimated to be 101002, whereas males are estimated a total of 101002 + 14088 = 115090. R creates dummy variables automatically: # Compute the model and b1 is the average difference in salary between males and females.įor simple demonstration purpose, the following example models the salary difference between males and females by computing a simple linear regression model on the Salaries data set.b0 + b1 is the average salary among males,.b0 is the average salary among females,. The coefficients can be interpreted as follow: Suppose that, we wish to investigate differences in salaries between males and females.īased on the gender variable, we can create a new dummy variable that takes the value:Īnd use this variable as a predictor in the regression equation, leading to the following the model: b0 and `b1 are the regression beta coefficients, representing the intercept and the slope, respectively. Recall that, the regression equation, for predicting an outcome variable (y) on the basis of a predictor variable (x), can be simply written as y = b0 + b1*x.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |