# Generate random data, place in data frame mydata
X1 <- rnorm(20)
X2 <- rnorm(20)
Y <- .7*X1 + .2*X2 + .6*rnorm(20)
# instead, if read data with the rad function
# then the result is the data frame called mydata
mydata <- data.frame(X1, X2, Y)
rm(Y); rm(X1); rm(X2)
# One-predictor regression
# Provide all default analyses including scatterplot etc.
Model(Y ~ X1)
# alternate form
model(Y ~ X1)
# Multiple regression model
# Provide all default analyses, including interactive 3d scatterplot
Model(Y ~ X1 + X2)
# t-test
Model(breaks ~ wool, dframe=warpbreaks)
# ANOVA analysis
# from another data frame other than the default \code{mydata}
# breaks is numerical, wool and tension are categorical
Model(breaks ~ wool + tension, dframe=warpbreaks)
Run the code above in your browser using DataLab