title: Error: variables were specified with different types from the fit with nlsw88 data
body: <p>I use data from STATA nlsw88 and make  model</p>
  
  <pre><code>h&lt;-read.dta("nlsw88.dta")
  h1&lt;-mutate(h,age = log(h$age),wage = log(h$wage))
  model2&lt;-lm(data=h1,wage~age+race+married+never_married+grade+collgrad+industry+union+occupation+hours+ttl_exp+tenure+c_city)
  </code></pre>
  
  <p>And when i want to predict, R write me error about "c_city" and "never_married factors" + without these factors it can't work </p>
  
  <pre><code>nd&lt;-data.frame(age=log(37),married = "married",union = "union",race = "white",grade = 14,never_married = "1"
                 ,collgrad = "college grad",industry = "Manufacturing",
                 occupation = "Operatives",hours = 48,ttl_exp = 10, tenure = 5,c_city = "0")
  predict(model2,nd)
  </code></pre>
  
  <p>Factors looks likes </p>
  
  <pre><code>&gt; head(h1)
    idcode      age  race married never_married grade         collgrad south smsa c_city               industry occupation
  1      1 3.610918 black  single             0    12 not college grad     0 SMSA      0 Transport/Comm/Utility Operatives
  2      2 3.610918 black  single             0    12 not college grad     0 SMSA      1          Manufacturing  Craftsmen
  3      3 3.737670 black  single             1    12 not college grad     0 SMSA      1          Manufacturing      Sales
  4      4 3.761200 white married             0    17     college grad     0 SMSA      0  Professional Services      Other
  5      6 3.737670 white married             0    12 not college grad     0 SMSA      0          Manufacturing Operatives
  6      7 3.663562 white married             0    12 not college grad     0 SMSA      0  Professional Services      Sales
       union     wage hours   ttl_exp    tenure
  1    union 2.462927    48 10.333334  5.333333
  2    union 1.856448    40 13.621795  5.250000
  3     &lt;NA&gt; 1.612777    40 17.730770  1.250000
  4    union 2.200974    42 13.211537  1.750000
  5 nonunion 2.089853    48 17.820513 17.750000
  6 nonunion 1.532477    30  7.326923  2.250000
  </code></pre>
  
  <p>What't wrong?</p>