Difference between revisions of "Dummy Variables in R"
(Created page with "In this section we explain how dummy variables can be used in Regressions == Dummy Variables == As we discussed in the Data Section categorical variables are lab...") |
(→Dummy Variables) |
||
Line 3: | Line 3: | ||
== Dummy Variables == | == Dummy Variables == | ||
− | As we discussed in the [[ R_Data|Data Section]] categorical variables are labelled as factor variables in R. As econometricians we often think of these as dummy variables. In [[R_Analysis#Some_basic_summary_statistics| the data analysis section]] we already learned how to get frequency counts of categorical variables using the <source enclose=none>table( )</source> command. | + | As we discussed in the [[ R_Data|Data Section]] categorical variables are labelled as factor variables in R. As econometricians we often think of these as dummy variables. In [[R_Analysis#Some_basic_summary_statistics| the data analysis section]] we already learned how to get frequency counts of categorical variables using the <source enclose=none>table( )</source> or <source enclose=none>summary( )</source> command. |
== Using Categorical/Factor variables in regressions == | == 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. | 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. |
Revision as of 07:58, 7 July 2015
In this section we explain how dummy variables can be used in Regressions
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.