Hello,
I am having an issue with the model recognizing the variables within the data frame and I am not entirely sure why this is happening.
Error: The following variables can neither be found in ‘data’ nor in ‘data2’: ‘RSLUpper’.
Code
#Read csv
Wap<-read.csv(“Wapengo.csv”,header=TRUE)
#Bind
Wap ← rbind(Wap)
#Arrange by age
Wap ← Wap %>% arrange(Age)
#Run model
library(brms)
m1 ← brm(RSL|mi(RSLUpper)~me(Age, Ageupper), data = Wap, save_mevars = TRUE)
Head of data so you can see structure
structure(list(Site = structure(c(1L, 1L, 1L, 1L, 1L, 1L), .Label = “Wapengo”, class = “factor”),
RSL = c(-0.068238463, -0.073155693, -0.02581141, -0.017379805,
-0.014178649, 0.026706959), RSLupper = c(0.16795545, 0.168146638,
0.16916378, 0.16951953, 0.168921232, 0.168238356), RSLlower = c(0.16795545,
0.168146638, 0.16916378, 0.16951953, 0.168921232, 0.168238356
), Age = c(1832L, 1860L, 1881L, 1894L, 1906L, 1913L), Ageupper = c(14.09253495,
13.7156267, 12.99997671, 12.25404364, 10.13081851, 10.19587526
), Agelower = c(14.09253495, 13.7156267, 12.99997671, 12.25404364,
10.13081851, 10.19587526), Rate = c(-0.037244426, -0.174854911,
2.332632731, 0.61776332, 0.279128313, 5.371978495)), row.names = c(NA,
6L), class = “data.frame”)