Generates the model matrix and adds information about variables to be penalized or non-penalized by the L1 term in the lasso fitting. The user will rarely call this function.

1 2 |

`m` |
call to the lasso function |

`formula` |
model formula |

`nonpen` |
formula defining the non-penalized variables |

`data` |
data.frame in which the variables are found |

`weights` |
as in lm |

`subset` |
as in lm |

`na.action` |
as in lm |

`contrasts` |
as in lm |

`env` |
environment in which the formula is evaluated |

This function generates the model.matrix and the 'index' vector which stores the information about penalization

`x` |
model.matrix |

`y` |
response |

`w` |
weights |

`off` |
offset |

`mf` |
model.frame |

`index` |
vector of length |

Lukas Meier, modified by Werner Stahelstahel@stat.math.ethz.ch

1 | ```
## not to be called by the user. Is called from function lasso.
``` |

Questions? Problems? Suggestions? Tweet to @rdrrHQ or email at ian@mutexlabs.com.

Please suggest features or report bugs with the GitHub issue tracker.

All documentation is copyright its authors; we didn't write any of that.

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.