Displaying 1 result from an estimated 1 matches for "log_theta".
2011 Sep 14
0
Convert SAS NLMIXED code for zero-inflated gamma regression to R
...t sure how to
re-write it for something like nlme (if at all possible - with conditions
etc). Does anyone know both languages enough to try translating it? Would
very much appreciate your help!
The code is as follows:
proc nlmixed data=mydata;
parms b0_f=0 b1_f=0
b0_h=0 b1_h=0
log_theta=0;
eta_f = b0_f + b1_f*x1 ;
p_yEQ0 = 1 / (1 + exp(-eta_f));
eta_h = b0_h + b1_h*x1;
mu = exp(eta_h);
theta = exp(log_theta);
r = mu/theta;
if y=0 then
ll = log(p_yEQ0);
else
ll = log(1 - p_yEQ0)
- lgamma(theta) + (theta-1)*log(y) - theta*log(r) - y/r;...