title: Variable(s) ‘group’ have been specified in ‘linfct’ but cannot be found in ‘model’!
body: <p>My question has been asked on a previous forum but for some reason the answer is not working for me. I am doing a planned comparison on log transformed data using R and I continue to get the error: 
  Error in mcp2matrix(model, linfct = linfct) : 
    Variable(s) ‘group’ have been specified in ‘linfct’ but cannot be found in ‘model’! 
  Any help would be appreciated. Thank you!</p>
  
  <p>Here's my data:</p>
  
  <pre><code>stress.data = read.table(textConnection(" group    rate   lnrate
  1      P  69.169 4.236553
  2      P  68.862 4.232105
  3      C  84.738 4.439564
  4      F  99.692 4.602085
  5      C  87.231 4.468560
  6      C  84.877 4.441203
  7      P  70.169 4.250907
  8      P  64.169 4.161520
  9      P  58.692 4.072303
  10     C  80.369 4.386629
  11     C  91.754 4.519111
  12     P  79.662 4.377793
  13     C  87.446 4.471021
  14     C  87.785 4.474891
  15     P  69.231 4.237449
  16     P  75.985 4.330536
  17     F  91.354 4.514742
  18     C  73.277 4.294247
  19     F  83.400 4.423648
  20     F 100.877 4.613902
  21     C  84.523 4.437024
  22     F 102.154 4.626481
  23     C  77.800 4.354141
  24     C  70.877 4.260946
  25     P  86.446 4.459520
  26     P  97.538 4.580242
  27     F  89.815 4.497752
  28     F  80.277 4.385483
  29     P  85.000 4.442651
  30     F  98.200 4.587006
  31     C  90.015 4.499976
  32     F 101.062 4.615734
  33     F  76.908 4.342610
  34     C  99.046 4.595584
  35     F  97.046 4.575185
  36     P  69.538 4.241873
  37     C  75.477 4.323828
  38     C  62.646 4.137500
  39     P  70.077 4.249595
  40     F  88.015 4.477507
  41     F  81.600 4.401829
  42     F  86.985 4.465736
  43     F  92.492 4.527122
  44     P  72.262 4.280298
  45     P  65.446 4.181225"), header = TRUE)
  
  library("multcomp")
  stress.lm= lm(stress.data$lnrate ~ stress.data$group, data = stress.data)
  stressPlanned= glht(stress.lm, linfct=mcp(group=c("C-P=0", "F-P=0")))
  </code></pre>
  
  <p>Error in mcp2matrix(model, linfct = linfct) : 
    Variable(s) ‘group’ have been specified in ‘linfct’ but cannot be found in ‘model’! </p>