Is there an R function / package like SAS PROC NLMIXED? I want to specify a likelihood function (which includes random effects, an assumed MVN) and maximize this approximate likelihood using a Gaussian quadrature or AGQ approach.
My ultimate goal is a beta regression model of random effects (with a variance submodem). At present, I do not think that this functionality exists in a package betaregor through an familyargument glmer lme4?
Below is my SAS PROC NLMIXED code:
proc nlmixed data=ttt method=gauss tech=trureg qpoints=5 ;
parms b0=0 b1=0 b00=1 b11=0 s2u=1 ;
bounds s2u>=0 ;
eta_mean = b0 + b1*x + u ;
eta_prec = b00 + b11*x ;
mu = exp(eta_mean)/(1 + exp(eta_mean));
phi = exp(eta_prec) ;
w = mu*phi;
t = phi - mu*phi;
ll = lgamma(w+t) - lgamma(w) - lgamma(t) + ((w-1)*log(y)) + ((t-1)*log(1 - y));
model y ~ general(ll);
random u ~ normal(0, s2u) subject=clust ;
run;
How can random effects (quadrature) be considered using R optimizers such as nlminbor optim? Or is there some other combination of R-functions more suitable for maximizing sufficiently general GLMM-likelihood in R?