Boris Kris
Boris Kris

Reputation: 501

Ordered factor variables in summary of linear model in R?

I have a linear model in R in which I include all possible 2-way interactions. One of the variables included in the model is JobAfter18:

> levels(AcademicData$JobAfter18)
[1] "No"                      "Yes, one job"            "Yes, two jobs"           "Yes, more than two jobs"

This variable has these 4 factor levels when viewed here. However, in the summary of the fit, it comes up as follows:

AcademicData$JobAfter18.L                                          34.042724  33.857406   1.005  0.31725    
AcademicData$JobAfter18.Q                                         -43.296277  20.763852  -2.085  0.03976 *  
AcademicData$JobAfter18.C                                         -14.816135   8.309894  -1.783  0.07782 .

Where are the L,Q, and C coming from, and what do they mean? I realize that factor variabels will include n-1 factor levels in the output, as the one not included is the baseline to which the others are compared. I am just not following why the levels are coming up with these letters rather than being written out, as they are for other variables, such as seen here with the "Sex" factor variable, which has levels "Male" and "Female":

AcademicData$SexMale                                               19.421651  12.331565   1.575  0.11863 

Upvotes: 5

Views: 4855

Answers (1)

DonJ
DonJ

Reputation: 963

L, Q and C are because JobAfter18 is set up as an ordered factor. See Interpretation of ordered and non-ordered factors, vs. numerical predictors in model summary for a nice explanation.

Upvotes: 2

Related Questions