I'm trying to run a two part ZAP GAM on r-inla, one bernoulli part (with the smoother) and a zero truncated poisson part (no smoother). I am having trouble combining the two parts, the code for this i am taking from the second volume of 'Beginners guide to Spatial, Temporal and Spatial-Temporal Ecological Data Analysis with R-INLA'.
The covariate matrix was taken from the Bernoulli part of the model to avoid having components of different lengths (page 391, vl 2).
Covariates <- data.frame(
Intercept = rep(1, N),
bath1 = basis_bath[,"bath1"],
bath2 = basis_bath[,"bath2"],
bath3 = basis_bath[,"bath3"],
bath4 = basis_bath[,"bath4"],
bath5 = basis_bath[,"bath5"],
bath6 = basis_bath[,"bath6"],
bath7 = basis_bath[,"bath7"],
bath8 = basis_bath[,"bath8"],
bath9 = basis_bath[,"bath9"],
dco1 = basis_dco[,"dco1"],
dco2 = basis_dco[,"dco2"],
dco3 = basis_dco[,"dco3"],
dco4 = basis_dco[,"dco4"],
dco5 = basis_dco[,"dco5"],
dco6 = basis_dco[,"dco6"],
dco7 = basis_dco[,"dco7"],
dco8 = basis_dco[,"dco8"],
dco9 = basis_dco[,"dco9"],
bath.std = MyStd(Skate$bath),
dcoast.std = MyStd(Skate$dcoast),
btemp.std = MyStd(Skate$btemp),
gravel.std = MyStd(Skate$gravel_sq),
current.std = MyStd(Skate$current),
sal.std = MyStd(Skate$sal_sq),
mud.std = MyStd(Skate$mud_sq)
)
So after running each model, validating and completing model selection, I have tried to run the following code:
The problem is that when i try to run the lines with the %*% in it, i get an error saying:
Can anyone give any pointers as to how i could fix this problem? I have a working understanding of the code but the underlying programming logic is still something i am new to.