title: Bootstrap LASSO Lambda
body: <p>I am trying to bootstrap lambda1 parameter in LASSO regression (using library penalized) (NOT the coefficients estimates as i KNOW that is does not make sense to calculate e.g. 95% CIs for them, this is the question about lambda1 ONLY).
  This is where I am so far:</p>
  <pre><code>df &lt;- read.table(header=T, text=&quot;group class v1 v2 
  1          Ala         1          3.98         23.2  
  2          Ala         2          5.37         18.5  
  3          C         1          4.73         22.1  
  4          B         1          4.17         22.3  
  5          C         2          4.47         22.4  
  &quot;) 
  </code></pre>
  <p>Tried this:</p>
  <pre><code>X&lt;-df[,c(3,4)] # data, variables in columns, cases in rows
  Y&lt;-df[,2] # dichotomous response
  for (i 1:100) {
  opt1&lt;-optL1(Y,X)
  opt1$lambda
  }
  </code></pre>
  <p>But got <code>Error: unexpected &quot;}&quot; in &quot;}&quot;</code></p>
  <p>Tried this:</p>
  <pre><code>f&lt;-function(X,Y,i){
  opt1&lt;-optL1(Y,X,[i])
  }
  boot(X,f,100)
  </code></pre>
  <p>But got <code>Error in boot (X,f,100): incorrect number of subscripts on matrix...</code> Can somebody help?</p>