# "Simulate" data following random and fixed effect specifications
# Chris Adolph
# June 2011
rm(list=ls())
library(simcf)
library(tile)
library(RColorBrewer)
set.seed(123456)
# "Random effects" model
# concept: grade vs hours of study on a set of assignments
# Create covariates
n <- 100 #Set the number of students
t <- 5 #Set the number of obs per student
beta = 0.75 #Set the slope of grades
sigmaAlpha <- 0.7 #Set the sd of the random effects
sigma <- 0.2 #Set the sd of the error term
rXm <- c(-0.7,.7) #Set the mean of hours of study
sdX <- 0.3 #Set the sd of hours of study
collist <- brewer.pal(9,"Set1") #Designate color list Set1
while (length(collist)