I'm trying to knit a glm in RMarkdown and I'm running into an issue. The console throws an error when trying to create the final model while knitting to html. However, when I run this piece of code in a regular script in R, I don't receive any errors.
the GLM run:
# Finished Model summary(model <- glmer(code ~ blocktype*cond + level + (1+ blocktype + cond | subject), data=data, family="binomial"), cor = FALSE) finalmodel = model
Error in h(simpleError(msg, call)) : error in evaluating the argument 'object' in selecting a method for function 'summary': Invalid grouping factor specification, subject
I checked and I don't have any missing values/NA values in my dataset. I have subject (labeled from 1-30), level (-1-1), code (0, 1) as numeric variables and the rest (blocktype and cond) are factor variables.
I'm wondering if this is an error with RMarkdown specifically since this error doesn't occur when run in the normal console or if it's a data-related problem since it says "invalid grouping factor specification"?
Any help is appreciated, let me know if you need any further information. Thank you!