title: Using a for loop to extract coefficients from multiple models
body: <p>I have multiple cox models (with one variable static in all models) and am trying to extract the coefficient for that variable. </p>
  
  <p>In all models the coefficient is indexed as follows: for example in model1 it is model1[[8]][1] ; for model2 it is model2[[8]][1] etc. I attempted to create a for loop but R as shown below but its not working. </p>
  
  <p>Could someone help me why I am getting an error when running the following code</p>
  
  <pre><code>for (i in 1:5) {
  coef[i] &lt;- exp(summary(model[i])[[8]][1])
  }
  </code></pre>
  
  <p>I get the following error "object 'model' not found".</p>
  
  <p>Many thanks in advance</p>
  
  <p>A</p>