myFormula
outputs the model formula based on discrete variables and continuous variables.
myFormula(data, resp = NULL, dom = NULL, ...)
data | the data frame. |
---|---|
resp | the response variable. |
dom | the random effect |
... | Other parameters. |
Returns an object of class for model formula
which is a symbolic formula based on the variables in the data set.
# Using discrete and continuous variables. data <- eversmoke y <- "smoke_ever" dom <- "county" catX <- c("age","gender","year","race") contX <- "povt_rate" if (FALSE) { myFormula(data, resp = y, fe.disc = catX, fe.cont = contX) as.formula(myFormula(data, resp = y, fe.disc = catX, fe.cont = contX)) # Only using discrete variables resp <- "smoke_ever" dom <- "county" fe.disc <- c("age","gender","year") myFormula(data=eversmoke, resp="smoke_ever", dom="county", fe.disc) as.formula(myFormula(resp,fe.disc)) # None of the variables are defined, this only output the response variable. resp <- "smoke_ever" dom <- "county" myFormula(data=eversmoke, resp="smoke_ever", dom="county") }