{"id":1489,"date":"2023-06-22T02:36:54","date_gmt":"2023-06-22T02:36:54","guid":{"rendered":"https:\/\/content.one.lumenlearning.com\/introstatstest\/chapter\/indicator-variable-learn-it-2\/"},"modified":"2025-05-17T02:44:48","modified_gmt":"2025-05-17T02:44:48","slug":"indicator-variable-learn-it-2","status":"publish","type":"chapter","link":"https:\/\/content.one.lumenlearning.com\/introstatstest\/chapter\/indicator-variable-learn-it-2\/","title":{"raw":"Indicator Variable - Learn It 2","rendered":"Indicator Variable &#8211; Learn It 2"},"content":{"raw":"<section class=\"textbox learningGoals\">\r\n<ul>\r\n\t<li><span data-sheets-value=\"{&quot;1&quot;:2,&quot;2&quot;:&quot;Define what an indicator variable is&quot;}\" data-sheets-userformat=\"{&quot;2&quot;:4609,&quot;3&quot;:{&quot;1&quot;:0},&quot;12&quot;:0,&quot;15&quot;:&quot;Calibri&quot;}\">Know what an indicator variable is<\/span><\/li>\r\n\t<li><span data-sheets-value=\"{&quot;1&quot;:2,&quot;2&quot;:&quot;Find and describe an appropriate multiple linear regression model equation with categorical predictors&quot;}\" data-sheets-userformat=\"{&quot;2&quot;:4609,&quot;3&quot;:{&quot;1&quot;:0},&quot;12&quot;:0,&quot;15&quot;:&quot;Calibri&quot;}\">Find and describe an appropriate multiple linear regression model equation with categorical predictors<\/span><\/li>\r\n<\/ul>\r\n<\/section>\r\n<h2>Indicator Variable<\/h2>\r\n<p class=\"para\">How can we incorporate a categorical variable like gender into a regression equation? This is done by using an indicator variable for the categorical variable and then using that variable in fitting the linear regression model.<\/p>\r\n<section class=\"textbox keyTakeaway\">\r\n<h3>indicator variable<\/h3>\r\n<p class=\"para\">An <b>indicator variable<\/b> is a binary variable with only two values: [latex]0[\/latex] and [latex]1[\/latex]. When creating an indicator variable, we assign the value of [latex]1[\/latex] for a certain category, and the value of [latex]0[\/latex] is used for all other categories.<\/p>\r\n<\/section>\r\n<p class=\"para\">An example of an indicator variable is the variable <i>schtyp<\/i> in the data set about the school type of the students. For the variable <i>schtyp<\/i>, the value of [latex]1[\/latex] indicates that the student attends a public school, and the value of [latex]2[\/latex] indicates that the student attends a private school.<\/p>\r\n<section class=\"textbox tryIt\">[ohm2_question hide_question_numbers=1]3254[\/ohm2_question]<\/section>\r\n<p>If there are [latex]k[\/latex]\u00a0levels of a categorical variable, we can create [latex]k-1[\/latex]\u00a0indicator variables to define our regression model. We use an indicator variable for a categorical variable in order to clarify which category we want as our reference group for the model equation.<\/p>\r\n<section class=\"textbox proTip\">A reference group is the value of the categorical variable that is not represented explicitly by the indicator variable (which is why we only require [latex]k-1[\/latex]\u00a0indicator variables to define our regression model).<\/section>\r\n<p>For example, the reference group for the indicator variable<em> public <\/em>[latex]0[\/latex] is the category indicating private school students.<\/p>\r\n<p>Recall that we are interested in building a prediction model that will allow us to predict science test scores based on math test scores and gender. After creating the indicator variable, our model will have math test scores and the indicator variable <em>female<\/em> as the explanatory variables.<\/p>\r\n<section class=\"textbox tryIt\">[ohm2_question hide_question_numbers=1]3262[\/ohm2_question]<\/section>\r\n<section class=\"textbox tryIt\">[ohm2_question hide_question_numbers=1]3263[\/ohm2_question]<\/section>","rendered":"<section class=\"textbox learningGoals\">\n<ul>\n<li><span data-sheets-value=\"{&quot;1&quot;:2,&quot;2&quot;:&quot;Define what an indicator variable is&quot;}\" data-sheets-userformat=\"{&quot;2&quot;:4609,&quot;3&quot;:{&quot;1&quot;:0},&quot;12&quot;:0,&quot;15&quot;:&quot;Calibri&quot;}\">Know what an indicator variable is<\/span><\/li>\n<li><span data-sheets-value=\"{&quot;1&quot;:2,&quot;2&quot;:&quot;Find and describe an appropriate multiple linear regression model equation with categorical predictors&quot;}\" data-sheets-userformat=\"{&quot;2&quot;:4609,&quot;3&quot;:{&quot;1&quot;:0},&quot;12&quot;:0,&quot;15&quot;:&quot;Calibri&quot;}\">Find and describe an appropriate multiple linear regression model equation with categorical predictors<\/span><\/li>\n<\/ul>\n<\/section>\n<h2>Indicator Variable<\/h2>\n<p class=\"para\">How can we incorporate a categorical variable like gender into a regression equation? This is done by using an indicator variable for the categorical variable and then using that variable in fitting the linear regression model.<\/p>\n<section class=\"textbox keyTakeaway\">\n<h3>indicator variable<\/h3>\n<p class=\"para\">An <b>indicator variable<\/b> is a binary variable with only two values: [latex]0[\/latex] and [latex]1[\/latex]. When creating an indicator variable, we assign the value of [latex]1[\/latex] for a certain category, and the value of [latex]0[\/latex] is used for all other categories.<\/p>\n<\/section>\n<p class=\"para\">An example of an indicator variable is the variable <i>schtyp<\/i> in the data set about the school type of the students. For the variable <i>schtyp<\/i>, the value of [latex]1[\/latex] indicates that the student attends a public school, and the value of [latex]2[\/latex] indicates that the student attends a private school.<\/p>\n<section class=\"textbox tryIt\"><iframe loading=\"lazy\" id=\"ohm3254\" class=\"resizable\" src=\"https:\/\/ohm.one.lumenlearning.com\/multiembedq.php?id=3254&theme=lumen&iframe_resize_id=ohm3254&source=tnh\" width=\"100%\" height=\"150\"><\/iframe><\/section>\n<p>If there are [latex]k[\/latex]\u00a0levels of a categorical variable, we can create [latex]k-1[\/latex]\u00a0indicator variables to define our regression model. We use an indicator variable for a categorical variable in order to clarify which category we want as our reference group for the model equation.<\/p>\n<section class=\"textbox proTip\">A reference group is the value of the categorical variable that is not represented explicitly by the indicator variable (which is why we only require [latex]k-1[\/latex]\u00a0indicator variables to define our regression model).<\/section>\n<p>For example, the reference group for the indicator variable<em> public <\/em>[latex]0[\/latex] is the category indicating private school students.<\/p>\n<p>Recall that we are interested in building a prediction model that will allow us to predict science test scores based on math test scores and gender. After creating the indicator variable, our model will have math test scores and the indicator variable <em>female<\/em> as the explanatory variables.<\/p>\n<section class=\"textbox tryIt\"><iframe loading=\"lazy\" id=\"ohm3262\" class=\"resizable\" src=\"https:\/\/ohm.one.lumenlearning.com\/multiembedq.php?id=3262&theme=lumen&iframe_resize_id=ohm3262&source=tnh\" width=\"100%\" height=\"150\"><\/iframe><\/section>\n<section class=\"textbox tryIt\"><iframe loading=\"lazy\" id=\"ohm3263\" class=\"resizable\" src=\"https:\/\/ohm.one.lumenlearning.com\/multiembedq.php?id=3263&theme=lumen&iframe_resize_id=ohm3263&source=tnh\" width=\"100%\" height=\"150\"><\/iframe><\/section>\n","protected":false},"author":8,"menu_order":16,"template":"","meta":{"_candela_citation":"[]","pb_show_title":"on","pb_short_title":"","pb_subtitle":"","pb_authors":[],"pb_section_license":""},"chapter-type":[],"contributor":[],"license":[],"part":1473,"module-header":"learn_it","content_attributions":[],"internal_book_links":[],"video_content":null,"cc_video_embed_content":{"cc_scripts":"","media_targets":[]},"try_it_collection":null,"_links":{"self":[{"href":"https:\/\/content.one.lumenlearning.com\/introstatstest\/wp-json\/pressbooks\/v2\/chapters\/1489"}],"collection":[{"href":"https:\/\/content.one.lumenlearning.com\/introstatstest\/wp-json\/pressbooks\/v2\/chapters"}],"about":[{"href":"https:\/\/content.one.lumenlearning.com\/introstatstest\/wp-json\/wp\/v2\/types\/chapter"}],"author":[{"embeddable":true,"href":"https:\/\/content.one.lumenlearning.com\/introstatstest\/wp-json\/wp\/v2\/users\/8"}],"version-history":[{"count":5,"href":"https:\/\/content.one.lumenlearning.com\/introstatstest\/wp-json\/pressbooks\/v2\/chapters\/1489\/revisions"}],"predecessor-version":[{"id":6911,"href":"https:\/\/content.one.lumenlearning.com\/introstatstest\/wp-json\/pressbooks\/v2\/chapters\/1489\/revisions\/6911"}],"part":[{"href":"https:\/\/content.one.lumenlearning.com\/introstatstest\/wp-json\/pressbooks\/v2\/parts\/1473"}],"metadata":[{"href":"https:\/\/content.one.lumenlearning.com\/introstatstest\/wp-json\/pressbooks\/v2\/chapters\/1489\/metadata\/"}],"wp:attachment":[{"href":"https:\/\/content.one.lumenlearning.com\/introstatstest\/wp-json\/wp\/v2\/media?parent=1489"}],"wp:term":[{"taxonomy":"chapter-type","embeddable":true,"href":"https:\/\/content.one.lumenlearning.com\/introstatstest\/wp-json\/pressbooks\/v2\/chapter-type?post=1489"},{"taxonomy":"contributor","embeddable":true,"href":"https:\/\/content.one.lumenlearning.com\/introstatstest\/wp-json\/wp\/v2\/contributor?post=1489"},{"taxonomy":"license","embeddable":true,"href":"https:\/\/content.one.lumenlearning.com\/introstatstest\/wp-json\/wp\/v2\/license?post=1489"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}