statsmodels ols does not include all categorical values I am doing an ordinary least squares regression (in python with statsmodels) using a categorical variable as a predictor. There are 5 values that the categorical variable can have. However, after running the regression, the output only includes 4 of them.

Here is what I am running:

&gt;&gt;&gt; from statsmodels.formula.api import ols
&gt;&gt;&gt; model = ols("normalized_score ~ C(general_subreddit)", data=df_feature)
&gt;&gt;&gt; results = model.fit()
&gt;&gt;&gt; results.summary()


The output of the last command includes the following rows in the table:


I can check the count of each of the categorical variables as follows:

&gt;&gt;&gt; from collections import Counter
&gt;&gt;&gt; Counter(df_feature["general_subreddit"])
Counter({nan: 20,
     'community': 4159,
     'ending_addiction': 3819,
     'mental_health': 4650,
     'other': 6920,
     'relationships': 4318})


Ignoring the NaNs, why does the categorical value of "community" not appear in the model summary?
When a logistic model is built using a categorical variable with N levels, it only considers N-1 levels, as the remaining level is used as a reference by the model.

What this means to your model as a whole is that, each level (when remaining variables remain same) is compared to the reference level. 

In your example, "community" level is used as the reference. So, ending_addiction contributes 0.0749 units more than "community" to the dependent variable.

Hit this up if it's not clear --> 
https://community.alteryx.com/t5/Alteryx-Designer-Discussions/In-the-Logistic-Regression-Report-Factor-Missing/m-p/10100/highlight/true#M5169