I want to write a random effect model for this regression :
randeffect<- lmer(effort~bs+bso+fe+st+maj+exp+hw+(randomeslope/randomgroupe))
I am beginner in r and actually don't know which code even lmer is useful for random effect model or not, moreover each of the independent variables are generated randomly, so they are not in the one data frame! My data are :
hw<- sample(0:1, 1000, replace =T)
exp<- sample(0:1, 1000, replace = T)
maj<- sample(0:1,1000,replace = T)
st<- sample(0:1,1000,replace = T)
fe<- sample(0:1,1000,replace = T)
effort <-sample(0:4, 1000,replace= T)
bso <- function(effort){
case_when(effort == 0~ 4500,
effort == 1~ 4300,
effort == 2~ 3700,
effort == 3~ 4700, TRUE ~ 5300)
}
bs <- function(effort){
case_when(effort == 0~ 2500,
effort == 1~ 3300,
effort == 2~ 3700,
effort == 3~ 3700, TRUE ~ 3300)
}
bs<-bs(effort)