5

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 
Boris Kris
  • 471
  • 1
  • 6
  • 6
  • that is probably due to your factor values got space within it. Try to remove space and check. – Bhavesh Ghodasara Nov 13 '17 at 09:39
  • Seems like there's a conflict somewhere. Maybe there's a part in your code that transforms variable `JobAfter18`. Or, maybe you have this variable twice? Check if you have a variable with name `JobAfter18.` as that dot there looks suspicious to me. Eg. Do you have variable `JobAfter18` that takes values `.L, .Q, .C`? Or variable `JobAfter18.` that takes values `L, Q, C`? – AntoniosK Nov 13 '17 at 12:47
  • I think this is genuinely strange and unrelated to the specific data. – MilesMcBain Jan 31 '18 at 12:43

1 Answers1

2

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.

DonJ
  • 923
  • 11
  • 18