I have the following code in SAS, and I need to recreate this model for the same data set in R. I am having trouble finding the proper code to recreate the model, especially changing the distribution of the data to a gamma distribution.
SAS Code
proc glimmix data=combined plot=(residualpanel studentpanel);
class block pen hour daymod;
model mean=hour|pen/solution ddfm=kr dist=gamma;
random _residual_/ subject=steer type=cs;
random block;
random intercept /subject=pen;
lsmeans hour/cl plots=meanplot;
output out=FinalModel pred=p resid=r lcl=lowlimit ucl=uplimit;
run;
Any Help would be Appreciated