# iris data, showing use with lm()
model1 <- lm(Sepal.Length ~ Petal.Length + Petal.Width, iris)
beta(model1) # all three variables standardized
model2 <- lm(Sepal.Width ~ Petal.Width + Species, iris)
beta(model2, skip='Species') # all variables except Species standardized
# mtcars data, showing use with glm()
model1 <- glm(vs ~ wt + hp, data=mtcars, family='binomial')
beta(model1) # wt and hp standardized, vs is not by default
Run the code above in your browser using DataLab