In: Statistics and Probability
R code
Need assistance in getting this R code to run variables (Process) char ( Age) char
tmp <- expand.grid(Process = unique(words$Process),Age
=unique(words$Age))
X <- model.matrix(~ factor(Process):factor(Age), data = tmp)
glht(mod, linfct = X)
I think your code is incomplete and i dont have data also to test it. So i have included one of the example for your reference and edited your code little bit,
Your Code -
#####################################
TEMP = expand.grid(height = seq(60, 80, 5), weight = seq(100, 300,
50),
sex = c("Male","Female"))
X = model.matrix(~ height:weight, data = TEMP)
glht(mod, linfct = X)
################################################
Example -
tmp <- expand.grid(Process = unique(words$Process)
Age =unique(words$Age),stringsAsFactors = TRUE)
X <- model.matrix(~ factor(Process):factor(Age), data = tmp)
glht(mod, linfct = X)