Answers.Body: <p>In statistics factor sometimes could simply refer to categorical variable especially when it's in your context of <em>levels of the factor</em> as referenced in R's factor function <a href="https://campus.datacamp.com/courses/basic-statistics/lab-0-the-basics-of-r?ex=15#" rel="nofollow noreferrer">here</a>:</p>
  <blockquote>
  <p>The term factor refers to a statistical data type used to store categorical variables... This means that &quot;student&quot; and &quot;not student&quot; are two values of the categorical variable student_status and every observation can be assigned one of these values. We can do this using the factor function.</p>
  </blockquote>
  <p>Also see wikipedia reference about <a href="https://en.wikipedia.org/wiki/Categorical_variable" rel="nofollow noreferrer">categorical variables</a>:</p>
  <blockquote>
  <p>Commonly (though not in this article), each of the possible values of a categorical variable is referred to as a level.</p>
  </blockquote>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2024-02-26T05:53:23.103Z
Answers.LastActivityDate: 2024-02-26T05:53:23.103Z
Answers.UserDisplayName: cinch
Answers.Body: <p>Let's say your have a factor called risk with 3 categories: high, low, medium. If you use a dummy variable to represent it, it should be: high-risk, low-risk, medium-risk. Either one of these values should be 1 and the rest of the 2 should be 0.</p>
  <p>Therefore, the levels of the factor is 3.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2024-02-26T02:48:59.410Z
Answers.LastActivityDate: 2024-03-02T17:29:06.013Z
Answers.LastEditDate: 2024-03-02T17:29:06.013Z
Answers.UserDisplayName: Gene
Body: <p>I am reading The elements of statistical learning : data mining, inference, and prediction / Trevor Hastie, Robert Tibshirani, Jerome Friedman and I don´t understand the meaning of &quot;factor&quot; in the following paragraph:</p>
  <p>Qualitative variables are typically represented numerically by codes. The
  easiest case is when there are only two classes or categories, such as “suc-
  cess” or “failure,” “survived” or “died.” These are often represented by a
  single binary digit or bit as 0 or 1, or else by −1 and 1. For reasons that will
  become apparent, such numeric codes are sometimes referred to as targets.
  When there are more than two categories, several alternatives are available.
  The most useful and commonly used coding is via dummy variables. Here a
  K-level qualitative variable is represented by a vector of K binary variables
  or bits, only one of which is “on” at a time. Although more compact coding
  schemes are possible, dummy variables are symmetric in the levels of the
  <strong>factor</strong>.</p>
  <p>Also I want to know what math´s knowledge I should have to understand this book and if it´s deprecated or not.</p>
  
Tags: <statistics>
Title: What´s does "factor" means in the context of dummy variables?
UserDisplayName: Martín Badino
ThreadText: # What´s does "factor" means in the context of dummy variables?
  
  (Asked by: username_0 on 2024-02-25)
  
  I am reading The elements of statistical learning : data mining, inference, and prediction / Trevor Hastie, Robert Tibshirani, Jerome Friedman and I don´t understand the meaning of "factor" in the following paragraph:
  
  Qualitative variables are typically represented numerically by codes. The
  easiest case is when there are only two classes or categories, such as “suc-
  cess” or “failure,” “survived” or “died.” These are often represented by a
  single binary digit or bit as 0 or 1, or else by −1 and 1. For reasons that will
  become apparent, such numeric codes are sometimes referred to as targets.
  When there are more than two categories, several alternatives are available.
  The most useful and commonly used coding is via dummy variables. Here a
  K-level qualitative variable is represented by a vector of K binary variables
  or bits, only one of which is “on” at a time. Although more compact coding
  schemes are possible, dummy variables are symmetric in the levels of the
  **factor**.
  
  Also I want to know what math´s knowledge I should have to understand this book and if it´s deprecated or not.
  
  **Tags:** statistics
  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_1 on 2024-02-26. Score: 0
  
  In statistics factor sometimes could simply refer to categorical variable especially when it's in your context of *levels of the factor* as referenced in R's factor function [here](https://campus.datacamp.com/courses/basic-statistics/lab-0-the-basics-of-r?ex=15#):
  
  > The term factor refers to a statistical data type used to store categorical variables... This means that "student" and "not student" are two values of the categorical variable student\_status and every observation can be assigned one of these values. We can do this using the factor function.
  
  Also see wikipedia reference about [categorical variables](https://en.wikipedia.org/wiki/Categorical_variable):
  
  > Commonly (though not in this article), each of the possible values of a categorical variable is referred to as a level.
  
  
  ---
  
  ### Answer by username_2 on 2024-02-26. Score: 0
  
  Let's say your have a factor called risk with 3 categories: high, low, medium. If you use a dummy variable to represent it, it should be: high-risk, low-risk, medium-risk. Either one of these values should be 1 and the rest of the 2 should be 0.
  
  Therefore, the levels of the factor is 3.
  
  
  ---
  
  