# NOT RUN {
data(DemoData2)
data(DemoMap2)
fit <- fitGeneric(data=DemoData2, geo=DemoMap2$geo,
Amat=DemoMap2$Amat, responseType="binary",
responseVar="tobacco.use", strataVar="strata",
weightVar="weights", regionVar="region",
clusterVar = "~clustid+id", CI = 0.95)
# Example with region-level covariates
Xmat <- aggregate(age~region, data = DemoData2, FUN = mean)
fit <- fitGeneric(data=DemoData2, geo=DemoMap2$geo,
Amat=DemoMap2$Amat, responseType="binary",
X = Xmat,
responseVar="tobacco.use", strataVar="strata",
weightVar="weights", regionVar="region",
clusterVar = "~clustid+id", CI = 0.95)
# }
Run the code above in your browser using DataLab