Description Usage Arguments Value Author(s) Examples
make.formula
is a function that easily converts a set of strings into a formula. It requires two arguments: a single response variable,
and a vector of strings. See examples.
1 | make.formula(response, predictors, random = NULL)
|
response |
a single string used on the left side of a formula |
predictors |
a string (or a vector of strings) representing the predictors. Each will be separated by a plus sign. |
random |
a string that indicates the random component in an |
a formula object
Dustin Fife
1 2 3 4 5 6 7 | k = data.frame(matrix(rnorm(100), ncol=5))
names(k) = LETTERS[1:5]
formula = make.formula("A", LETTERS[2:5])
formula
lm(formula, data=k)
#do a random model
make.formula("A", LETTERS[2:5], random="(1|group)")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.