Difference between revisions of "Dummy Variables in R"

From ECLR
Jump to: navigation, search
(Dummy Variables)
Line 1: Line 1:
In this section we explain how dummy variables can be used in Regressions
+
In this section we explain how dummy variables can be used in Regressions and we will utilise the Baseball Wages  [[R#Data_Sets|dataset]] for this purpose.
  
 
== Dummy Variables ==
 
== Dummy Variables ==

Revision as of 09:20, 7 July 2015

In this section we explain how dummy variables can be used in Regressions and we will utilise the Baseball Wages dataset for this purpose.

Dummy Variables

As we discussed in the Data Section categorical variables are labelled as factor variables in R. As econometricians we often think of these as dummy variables. In the data analysis section we already learned how to get frequency counts of categorical variables using the table( ) or summary( ) command.

Using Categorical/Factor variables in regressions

When using such categorical variables in regressions as explanatory variables we will use them in the form of dummy variables. Our practice dataset doesn't have any real factor variables (remember, wages and log(wages) were initially treated as factor variables due to the missing values.