Displaying 1 result from an estimated 1 matches for "x1g".
Did you mean:
x11
2011 Jun 27
1
group interaction in a varying coeff. model (mgcv)
Dear UseRs,
I built varying coefficient models (in mgcv) for two groups separately, with one explanatory and one moderator variable (see the example below).
# -------
# Example:
# ------
# generate moderator variable (can the same for both groups)
modvar <- c(1:1000)
# generate group1 values
x1 <- rnorm(1000)
y1 <- scale(cbind(1,poly(modvar,2))%*%c(1,2,1)*x1 +
rnorm(1000,0,0.3))
#