my unexpected symbol is a capital letter?

apparently there is an unexpected symbol in my coding. this is what is says in the console:

> source('~/.active-rstudio-document')
Error in source("~/.active-rstudio-document") : 
  ~/.active-rstudio-document:27:1: unexpected symbol
26: #main effect model 
27: Model_ME

so i know the error is on my 27th line and the first character, this is what is in my script in that location...

Model_ME <- glmer (BinaryResponse ~ 1 + (1|ImageFace) + (1|ImageSex) + (1|ImageEthnicity), data = CompleteData, family = "binomial")

im so confused i did a similar formula to this above and was no issues? ill insert here..

Model_Null <- glmer (BinaryResponse ~ 1 + (1|TrailNumber) + (1|PPTID), data = CompleteData, family = "binomial"

please help me whats the unexpected symbol?

it might be unexpected based on the preceding code.
What code precedes it ?

Not necessarily. It is only the where the expression that contains the error begins. Often the unexpected symbol reflects unmatched delimiters. Perhaps, as per @nirgrahamuk on line 25 above. Or it may be due to a delimiter problem, which are easier to detect with formatting as below.

library(lme4)
#> Loading required package: Matrix
cbpp$obs <- 1:nrow(cbpp)
gm2 <- glmer(cbind(incidence, size - incidence) ~ period +
            (1 | herd) +  
            (1 | obs),
            family = binomial, 
            data = cbpp)
gm2
#> Generalized linear mixed model fit by maximum likelihood (Laplace
#>   Approximation) [glmerMod]
#>  Family: binomial  ( logit )
#> Formula: cbind(incidence, size - incidence) ~ period + (1 | herd) + (1 |  
#>     obs)
#>    Data: cbpp
#>      AIC      BIC   logLik deviance df.resid 
#> 186.6383 198.7904 -87.3192 174.6383       50 
#> Random effects:
#>  Groups Name        Std.Dev.
#>  obs    (Intercept) 0.8911  
#>  herd   (Intercept) 0.1840  
#> Number of obs: 56, groups:  obs, 56; herd, 15
#> Fixed Effects:
#> (Intercept)      period2      period3      period4  
#>      -1.500       -1.226       -1.329       -1.866

See the FAQ: How to do a minimal reproducible example reprex for beginners

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.