Learn R Programming

predict3d (version 0.1.5)

getNewFormula: Make new formula

Description

Make new formula

Usage

getNewFormula(fit, predictors = NULL)

Arguments

fit

An object of class lm or glm

predictors

Names of variables to exclude

Examples

Run this code
fit=lm(mpg~factor(cyl)*factor(am)+wt+carb,data=mtcars)
getNewFormula(fit,predictors=c("cyl","wt"))
fit=lm(Sepal.Length~Sepal.Width*Petal.Length+Species,data=iris)
getNewFormula(fit,predictors=c("Petal.Length"))
fit=lm(mpg~hp*wt*factor(cyl),data=mtcars)
getNewFormula(fit,predictors=c("hp","cyl"))
fit=loess(mpg~hp*wt,data=mtcars)
getNewFormula(fit,predictors=c("hp","wt"))

Run the code above in your browser using DataLab