R/toureg.formula.R

toureg.formula <- function(formula, data=list(), x = FALSE, y = FALSE, ...)
{
  data <- na.omit(data)
  mf <- model.frame(formula=formula, data=data)
  terms <- attr(mf, "terms")
    
  fit <- toureg.default(x=model.matrix(terms, mf), y=model.response(mf), ...)  
  
  fit$terms <- terms
  fit$formula <- formula
  fit$data <- data
  fit$call <- match.call()
  if(y) fit$y <- model.response(mf)
  if(x) fit$x <- model.matrix(terms, mf)
  fit
}

Try the touchard package in your browser

Any scripts or data that you put into this service are public.

touchard documentation built on May 31, 2019, 5:04 p.m.