#--------------------
# family = "gaussian"
#--------------------
X0 <- data.frame(x1 = rnorm(50), # standard normal variable
x2 = sample(0:2, 50, replace=TRUE), # categorical variable
x3 = sample(0:1, 50, replace=TRUE)) # dichotomous variable
n.par(X0) # without dummy variables
X0$x2 <- as.factor(X0$x2)
X0$x3 <- as.factor(X0$x3)
n.par(X0) # with dummy variables
X1 <- data.frame(Intercept = rep(1,30),
x1 = rnorm(30), # continuous variable
x2 = sample(0:2, 30, replace=TRUE)) # categorical variable
n.par(X1) # without dummy variables
X1$x2 <- as.factor(X1$x2)
n.par(X1) # without dummy variables
# a list of two data sets:
X01 <- list(X0, X1)
n.par(X01)
Run the code above in your browser using DataLab