I have a data set of skewed nutrient intake values, from around 7800 individuals, of whom around 3000 had two measures of daily nutrient intake (the others only had one measure), so this is a repeated measures design, very unbalanced. The boxcox
transformation in the MASS
package in R
identified a suitable lambda (0.4) to use for the transformation to linearity, and the nutrient value transformation takes the normal Box Cox form of (x^L-1)/L
where x
is the nutrient intake value (&response
) and L
is lambda (0.4 in this case). The purpose of this transformation is to provide a linear dependent variable for a subsequent nlmer
analysis in R
although the original analysis was performed in SAS
.
PROC NLMIXED
in SAS
, unlike other SAS
procedures, requires a user-specified MODEL
statement. In the SAS
code, a general log likelihood function has been provided, which is (rest of SAS
syntax omitted, the &
are there as the syntax uses SAS
macro language):
ll1=log(1/(sqrt(2*pi*A_VAR_E)));
ll2=(-(boxcoxy-x2b2u2)**2)/(2*A_VAR_E)+(&amtlambda-1)*log(&response);
ll=ll1+ll2;
model &response ~ general(ll);
I can follow some of this log likelihood specification, as I can see some relationship to the probability density function of the normal distribution. But I don't understand the parameterisation to the dataset at hand. The values are:
A_VAR_E
appears to be the variance of the residualsboxcoxy
is the BoxCox-transformed values of&response
x2b2u2
is the fitted values based on the fixed and random effects in the model (incorporates age, race, weekend intake effects)&amtlambda
is 0.4 in this case&response
is the raw nutrient intake value, that was Box Cox transformed toboxcoxy
, and is the dependent variable in this analysis.
This likelihood function seems to have deviated from the usual form. In particular, I do not understand why ll2
incorporates (&amtlambda-1)*log(&response)
into the denominator. What is this part of the likelihood function doing? Why would the dependent variable &response
be on both sides of the equation in the model statement? In ll2
the dependent variable appears to be included twice, once as its transformation boxcoxy
in the numerator and once as its raw value in the denominator.
I would appreciate any help with understanding why this likelihood has been parameterised this way.