title: R model variable score
body: <p>I built a linear regression model in R and tried to get the contribution amount (not the coefficient) of each of the explanatory variables (independent variables) (i.e. x1, x2, x3). Question:</p>
  <ol>
  <li>How can I get such amount for the fitted data. That is numeric value contributed by each x (x1, x2, x3) for each observation.</li>
  <li>How can I get the same amount for new (unseen) data</li>
  </ol>
  <pre><code>df = data.frame(y, x1, x2, x3)
  mod = lm(y ~ x1 + x2 + x3, data = df)
  </code></pre>