Skip to main content
NIHPA Author Manuscripts logoLink to NIHPA Author Manuscripts
. Author manuscript; available in PMC: 2013 May 28.
Published in final edited form as: Stat Med. 2012 Aug 3;31(26):3192–3210. doi: 10.1002/sim.5393

A Three-Level Mixed-Effects Location Scale Model With An Application To Ecological Momentary Assessment (EMA) Data

Xue Li 1,*, Donald Hedeker 2
PMCID: PMC3665350  NIHMSID: NIHMS470639  PMID: 22865663

Abstract

In studies using Ecological Momentary Assessment (EMA), or other intensive longitudinal data collection methods, interest frequently centers on changes in the variances, both within-subjects (WS) and between-subjects (BS). For this, Hedeker et al. (Biometrics 2008; 64: 627-634) developed an extended two-level mixed-effects model that treats observations as being nested within subjects and allows covariates to influence both the WS and BS variance, beyond their influence on means. However, in EMA studies, subjects often provide many responses within and across days. To account for the possible systematic day-to-day variation, we developed a more flexible three-level mixed-effects location scale model that treats observations within days within subjects, and allows covariates to influence the variance at the subject, day, and observation level (over and above their usual effects on means) using a log-linear representation throughout. We provide details of a maximum likelihood (ML) solution and demonstrate how SAS PROC NLMIXED can be used to achieve ML estimates in an alternative parameterization of our proposed three-level model. The accuracy of this approach using NLMIXED was verified by a series of simulation studies. Data from an adolescent mood study using EMA was analyzed to demonstrate this approach. The analyses clearly show the benefit of the proposed three-level model over the existing two-level approach. The proposed model has useful applications in many studies with three-level structures where interest centers on the joint modeling of the mean and variance structure.

Keywords: heteroscedasticity, location scale model, log-linear variance, multilevel data, variance modeling, maximum marginal likelihood

1. Introduction

For longitudinal data, mixed-effects regression models (MRMs) usually include random subject effects to account for the similarity among repeated measures for a given subject. The variance of the random subject effects, which represents between-subjects (BS) variation and the error variance, which represents within-subjects (WS) variation, are usually considered to be homogeneous across subject groups or levels of covariates. However, in reality, the homogeneous variance assumption, both within- and between-subjects, can be violated, and the random subject effects can further be correlated with the error terms. Non-homogeneous variance is often referred to as heteroscedasticity. By allowing for heteroscedasticity of within- and between-subjects variation, the standard errors of the fixed-effects parameter estimates may be reduced, sometimes dramatically, and the precision of the estimation therefore increased.

Modern data collection procedures, such as ecological momentary assessments (EMA) [1, 2], experience sampling [3], and diary methods [4], have been developed to record the momentary events and experiences of subjects in daily life. These procedures yield relatively large BS and WS data, which allows the possibility to assess intra-individual variability and changes in the variances. The data from such designs are sometimes referred to as intensive longitudinal data [5].

Data from EMA usually have up to thirty or forty observations per subject, and are inherently multilevel; for example, (level-1) occasions nested within (level-2) subjects, or more accurately, (level-1) occasions nested within (level-2) days which are in turn nested within (level-3) subjects. Thus, linear mixed models are increasingly used for EMA data analysis [5, 6]. A particular interest in EMA studies is the modeling of BS and WS variances as a function of covariates, in addition to their effect on the overall mean levels. For this, Cleveland et al. [7, 8] first proposed a general class of models, mixed-effects location scale (LS) models, for WS variance modeling which includes one or more random effects to characterize an individual's mean response (location), and an additional random (scale) effect in the error variance to characterize the variability around an individual's mean response. Following their work, two-level mixed-effects LS models have been described allowing for the effects of covariates on both the WS and BS variances [9, 10] but without including a random scale effect in the error variance. The recent work by Hedeker and others [11, 12] built upon this previous work by including a random scale effect in the error variance and also allowing for correlation between the random location and scale effects. However an aspect that is ignored in all these two-level analysis of EMA data is the possibility of systematic day-to-day variation. As noted above, the observations are also nested within days (as well as subjects) and such day-to-day variation is simply treated as part of the WS variance in a two-level model. For example, a person's mood can vary from day to day, as well as within a day. Thus, mood can vary between subjects (some feel happy and some feel sad), within subjects but between days (some days are better and some days are worse for a given subject), and within subjects and days (mood can vary across the hours of the day for a given subject). A three-level model that treats occasions within days within subjects and separates between- and within-day variation therefore represents a fuller examination for the analysis of EMA data. However the existing methodology and software does not exist for such a general three-level model. Therefore, there is a need for developing methods for a three-level analysis with general variance modeling and random scale effects, and providing a convenient software program that is accessible via the major packages such as SAS.

In this article, we develop a three-level mixed-effects LS model with a three-level structure as: occasions (level-1) nested within days (level-2) nested within subjects (level-3). The proposed model is based on a conventional three-level MRM with a random intercept at each level, but also allows covariates to influence the variances at each level, using a log-linear representation throughout. The error variance is further allowed to vary across subjects above and beyond the contribution of covariates through a normally distributed random (scale) effect. Thus, the error variance follows a log-normal distribution. Furthermore, the random scale effect is allowed to be correlated with the random location effect. We demonstrate how the SAS procedure PROC NLMIXED can be used to obtain maximum likelihood estimates of the proposed three-level model by reformulating the three-level model in a two-level formulation through a multivariate conditional likelihood approach. A syntax example is provided in Appendix to facilitate this. The accuracy of this approach using NLMIXED was verified using a series of simulation studies. We also provide details of the maximum likelihood (ML) solution using a Fisher Scoring algorithm and Gauss-Hermite quadrature, so that researchers can produce their own programs using other software platforms. The proposed three-level mixed-effects LS model is illustrated using data from an EMA adolescent mood study, where interest is on determinants of the variation in the adolescents’ moods.

2. Motivating adolescent mood study example

The data that motivated the development of the three-level mixed-effects LS model is from a study of mood among adolescents. Subjects were either 9th or 10th graders at baseline, 55.1% female, and self-reported on a screening questionnaire, 6-8 weeks prior to baseline, that they had smoked at least one cigarette in their life. The majority (57.6%) had smoked at least one cigarette in the past month at baseline. The study used a multi-method approach to assess adolescents at multiple time points in terms of self-report questionnaires, in-depth interviews, and week-long EMA sampling via hand-held palmtop computers. Here, we focus on the data from the baseline EMA collection. Adolescents carried hand-held computers for a seven-consecutive-day data collection period and were trained to respond to random prompts from the computers and also to self-initiate event recordings of smoking episodes. In this article, we focus on the responses from random prompts, which were date- and time-stamped, and were initiated by the device approximately 4 times per day (range 1-8). Questions asked about location, activity, companionship, mood, and other behaviors. A total of 14,105 random prompts were obtained on 3,642 days from 461 subjects with an approximate average of 30 prompts per subject (range = 7 to 71). For the analyses reported, a three-level structure of random prompts (level-1) within measured days (level-2) within subjects (level-3) was considered. Some information from the self-initiated smoking events was used as covariates.

We considered two continuous outcomes: measures of the subject's negative affect (NA) and positive affect (PA) before the prompt signal. Both NA and PA consisted of the average of several mood items, each rated from 1 to 10 (with “10” representing very high levels of the attribute). NA consisted of 5 items to assess pre-prompt negative mood: I felt sad, I felt stressed, I felt angry, I felt frustrated, and I felt irritable; and PA consisted of 5 items assessing positive mood just before the prompt: I felt happy, I felt relaxed, I felt cheerful, I felt confident, and I felt accepted by others. Higher NA score reflects relatively poorer moods; whereas higher PA scores indicate relatively better mood. In this study, interest focuses on the degree to which covariates explain between-subject (BS), within-subject between-day (WS-BD), and within-subject within-day (WS-WD) variation in NA and PA, over and above their influence on the mean response. In particular, the effect of a subject's smoking level on both the mean response and variance heterogeneity were examined.

3. Three-level mixed-effects location scale model

To describe the model, the three-level data structure is defined as follows: Assume that there are k =1, ..., nij level-1 units that are nested within j=1, ..., ni level-2 units that are in turn nested within i = 1, ..., n level-3 units. The three-level mixed-effects model with random intercepts at both level-2 and 3 can be written as

yijk=xijkTβ+γi+υij+εijk. (1)

In the adolescent mood study that was used as an example for motivation and illustration, occasions (level-1) were nested within days (level-2) and nested within subjects (level-3). The outcome yijk is the mood affect measurement, either negative affect or positive affect, of subject i on day j and on occasion k. The covariate vector xijk (first element is one) includes level-1, 2 and 3 explanatory variables, and β is the corresponding vector of regression coefficients. The random subject effect γi indicates the mood affect influence of subject i, while the random day effect υij represents the influence on mood of subject i on day j. These random effects are referred to as random location effects in the context of LS models. The population distributions of γi and υij are assumed to be normal distributions with N(0,σγ2) and N(0,συ2) respectively. The errors εijk are also assumed to be normal with N(0,σe2) and independent of the random effects at both level 2 and 3. In the adolescent mood example, σe2 is the WS-WD variance, συ2 represents the WS-BS variance and σγ2 is the BS variance. Since the level-3 subscript i is present for the both ni and nij, not all level-2 units are assumed to have the same number of level-1 units nested within, and not all level-3 units are assumed to have the same number of level-2 units nested within. In other words, there is no assumption of equal sample size at any level.

By allowing for heteroscedasticity of random effect (level-2 and 3) variances and error variances at each level, we can further allow covariates to influence these variances. As such, we can utilize a log-linear representation, as has been described in the context of heteroscedastic regression models [13, 14], namely,

log(σγi2)=πiTλ,log(συij2)=uijTαandlog(σεijk2)=ϖijkTτ. (2)

The variances are subscripted by i, j and k to indicate that their values change depending on the values of the covariates πi, uij and ϖijk (and their coefficients), which include a (first) column of ones. The number of parameters associated with these variances does not vary with i or j or k. Thus, the variance of level-3 random effect σγi2 equals exp(λ0) when the level-3 covariates πi equal 0, and is increased or decreased as a function of these covariates and their coefficients λ. We chose a log function here to ensure that the variance would be positive. The variances of level-2 random effects and the error variance are modeled in the same way, except that both level-2 and 3 covariates (uij) may influence συij2; and covariates from all three levels (ϖijk) may influence σεijk2. The coefficients in λ, α and τ indicate the degree of influence on the variances σγi2, συij2 and σεijk2 respectively, and the ordinary three-level random intercept model is obtained as a special case if λ = α = τ = 0 for all covariates in πi, uij and ϖijk, excluding the reference variance λ0, α0 and τ0.

The error variance σεijk2 can be further modeled to vary across individuals, above and beyond the contribution of covariates, namely,

log(σεijk2)=ϖijkTτ+ωi, (3)

where the random level-3 scale effects ωi have a normal distribution with zero mean and variance σω2. Thus, the variance σεijk2 is a random variable that has a log-normal distribution. The choice of the skewed and nonnegative log-normal distribution for σεijk2 has been used in many diverse research areas for representing variances [15-19]. In this model, the random location effects γi and υij indicate how level-3 units differ in terms of mean levels, while the random scale effects ωi indicate how level-3 units differ in variation, beyond the effect of covariates. Thus, the model with both types of random effects (random location and random scale) is referred to as a mixed-effects LS model. The level-3 random location effects γi and random scale effects ωi are further correlated with covariance parameter σγω, and each is independent of level-2 random location effects υij. This covariance parameter indicates the degree to which level-3 random location and scale effects are associated. In the adolescent mood study, it shows how a subject's mood affect mean is associated with their mood variation. Jointly, υij, γi and ωi are assumed to have a multivariate normal distribution with zero mean and variance-covariance matrix as described in (4).

[υijγiωi]N([000],[συij2000σγi2σγω0σγωσω2]). (4)

For estimation purposes, the random effects are usually expressed in standardized form (i.e., as multivariate standard normal) using the Cholesky factorization, namely:

(υijγiωi)=[συij000σγi00σγωσγiσω2σγω2σγi2][θijθ1iθ2i]. (5)

The model (1) can be rewritten as yijk=xijkTβ+σγiθ1i+συijθij+σεijkeijk, where eijk has a standard normal distribution, and σεijk is the standard deviation of εijk given ωi and is expressed as

σεijk=exp{12(ϖijkTτ+σγωσγiθ1i+σω2σγω2σγi2θ2i)}. (6)

The random effects θ1i, θ2i and θij are pairwise independent, and each follows a univariate normal distribution with zero mean and unit variance, and each is independent of eijk. Given ωi the error εijk has a normal distribution with zero mean and variance σεijk2=exp(ϖijkTτ+ωi). The marginal distribution of εijk, however, is no longer normal and instead it has a complex form involving the product of a log-normal random variable σεijk with a standard normal random variable eijk. As such, the marginal distribution of yijk is also not normal and its marginal mean and variance are, respectively, xijkTβ and exp(uijTα)+exp(πiTλ)+exp(ϖijkTτ+0.5σω2).

4. Maximum marginal likelihood estimation

Parameters are estimated using a maximum marginal likelihood (MML) estimation method. The details about the estimation are described in Appendix A. Fisher's method of scoring can be used to provide the solution to the likelihood equations. For this, provisional estimates for the vector of parameters ψ=(β,λ,α,τ,σγω,σω2)T on iteration t are improved by

ψt+1=ψtE(2logLψtψtT)1Lψt, (7)

where the information matrix, or minus the expectation of the matrix of second derivatives, is

E(2logLψtψtT)=i=1nh2(yi)h(yi)ψt(h(yi)ψt)T. (8)

The right-hand side is often referred to as the BHHH method due to Berndt et al. [20]. At convergence, the large-sample variance-covariance matrix of the parameter estimates is then obtained as the inverse of the information matrix in (8). In the MML solution, numerical integration is performed on the transformed θ* space, specifically Gauss-Hermite quadrature can be used to approximate the integrals by summations on Q quadrature points for each dimension of the integration. Further details on the quadrature approach aredescribed in Gibbons and Hedeker [21] and Raman and Hedeker [22].

5. Computer implementation

The MML solution presented in Appendix A can be programmed using, say, FORTRAN or C++. Alternatively, the SAS program PROC NLMIXED can also be used for MML estimation. In general, three-level models cannot be fit in PROC NLMIXED, which allows only a single level of random effects. However, the general statement in PROC NLMIXED allows one to write a multivariate conditional likelihood and hence can fit a three-level model. For this, the log-likelihood needs to be derived in a closed form and the dataset needs to be reshaped into a two-level form. In this regard, Gueorguieva [23] reformulated a three-level correlated probit model (level-1 repeated measures nested within level-2 fetus, which in turn are nested within level-3 litters) to a two-level form, and fit the reformulated two-level model in PROC NLMIXED. Her approach, however, only allows for two level-1 observations nested within each level-2 fetus. Alternatively, the SAS program developed here allows for unlimited level-1 observations nested within level-2 units, in turn nested within level-3 units. The details of this approach are described in Appendix B. A SAS syntax example for the proposed three-level mixed-effects LS model, as well as the first 13 observations from a hypothetical dataset used to illustrate the construction of the conditional log-likelihood, is provided in Appendix C. The starting values for parameters β0, λ0, α0 and τ0 were obtained from a three-level random intercept model without any covariates at the mean level, and the random scale variance and covariance terms (σω2 and σγω) were estimated from a two-level mixed-effects LS model without any covariates. All the remaining parameters were set to 0s. More details are provided in Appendix C.

6. Simulation study

A series of simulations using one thousand data sets, each with 11200 observations (4 level-1 observations within each of the 7 level-2 units within each of the 400 level-3 units), were generated under the proposed three-level mixed-effects LS model with three covariates (either continuous or dichotomous), one at each level, to assess the accuracy and reliability of the proposed three-level model using PROC NLMIXED. We also compared its performance to a simpler three-level random intercept model. These covariates were specified to have effects on the variances as well as the mean. Therefore, the fixed-effects covariate vector xijk and the covariate vector ϖijk in error variance include covariates from level-1, 2 and 3 (i.e., X1, X2 and X3 respectively); the covariate vector uij in level-2 random effect variance includes level-2 (X2) and level-3 (X3) covariates; and the covariate vector πi in level-3 random effect variance includes the level-3 covariate X3. Three levels (small, medium, large) of random scale variance (σω2) along with two opposite covariances (συω) were further evaluated. Standardized biases (SBs), root mean square errors (RMSEs), 95% confidence interval (CI) coverage probabilities, and average lengths of 95% CIs over the 1000 unique datasets were assessed to evaluate model performance as described by Demirtas [24].

We present in Table I the results from one set of simulations which included three continuous covariates: X1 ~ N(μ = 0.5, σ = 0.5), X2 ~ N(μ = –0.2, σ = 1.2) and X3 ~ N(μ = 0, σ = 0.7) at level -1, 2 and 3, respectively. The simulation results reveal that the proposed three-level LS model using PROC NLMIXED recovers the assigned parameter values (β, λ, α, τ, συω) adequately, as indicated by small biases and RMSEs, acceptable standardized bias, and close to 95% coverage. We obtained similar findings in all other scenarios that, for space, are not presented here. These additional results are available at http://www.uic.edu/classes/bstt/bstt513/pubs.html. For the variance of the random scale effect σω2, the average of the estimated values is close to the true value, but the coverage tends to decrease to around 86% when the size of the random scale effect is large. In general, as is well known, using the Wald test for a variance parameter is not ideal. Except for somewhat minor underestimation of the random scale variance parameter, the inferences and conclusions for all other parameters are fairly good using PROC NLMIXED.

Table I.

Results from 1000 simulations under the three-level mixed-effects location scale model - three continuous covariates and small random scale effect and positive covariance.

Three-level Random Intercept Model
Three-level Mixed-effects Location Scale Model
Parameters True Value EST SE* Bias SB RMSE 95% COV AW EST SE* Bias SB RMSE 95% COV AW
β0 : (Intercept) 6.90 6.899 0.06 -0.0012 -2.16 0.06 95.9 0.23 6.899 0.06 -0.0011 -1.99 0.06 95.8 0.23
β1 : (X1) -0.40 -0.400 0.03 0.0002 0.80 0.03 95.4 0.11 -0.400 0.02 0.0003 1.13 0.02 94.5 0.10
β2 : (X2) 0.20 0.200 0.01 0.0001 0.50 0.01 95.5 0.06 0.200 0.01 0.0001 0.84 0.01 95.8 0.06
β3 : (X3) 0.60 0.603 0.08 0.0031 3.66 0.08 94.8 0.32 0.604 0.08 0.0037 4.41 0.08 94.3 0.32
λ0 : (Intercept) 0.20 0.194 0.08 -0.0056 -7.34 0.08 96.2 0.30 0.186 0.08 -0.0136 -17.90 0.08 96.1 0.30
λ1 : (X3) -0.10 -0.100 0.11 0.0002 0.19 0.11 94.4 0.42
α0 : (Intercept) -1.20 -1.136 0.08 0.0641 77.06 0.10 82.3 0.29 -1.199 0.07 0.0011 1.62 0.07 95.2 0.28
α1 : (X2) -0.10 -0.102 0.06 -0.0019 -3.11 0.06 94.2 0.24
α2 : (X3) -0.40 -0.404 0.10 -0.0037 -3.68 0.10 94.4 0.38
τ0 : (Intercept) 0.40 0.635 0.04 0.2351 644.84 0.24 0.0 0.06 0.398 0.04 -0.0015 -4.26 0.04 94.8 0.14
τ1 : (X1) 0.10 0.099 0.03 -0.0007 -2.44 0.03 96.4 0.13
τ2 : (X2) -0.10 -0.100 0.01 -0.0002 -1.32 0.01 94.7 0.05
τ3 : (X3) -0.20 -0.200 0.04 -0.0004 -0.89 0.04 95.6 0.18

σω2 0.30 0.289 0.03 -0.0106 -38.36 0.03 91.0 0.11
σ ν ω 0.15 0.151 0.04 0.0011 2.88 0.04 94.2 0.14

-2LogL 41338.5 40326.8

# of converged solutions 999 975
*

Estimated standard errors are based on the distribution of the 999 or 975 parameter estimates from the random-intercept model or mixed-effects location scale model, respectively.

The results from the traditional three-level random intercept model, which ignores the random scale effects and covariate effects on variances, indicate good recovery of the mean effects (β). However, this model yields badly biased estimates of the variance parameters. As is demonstrated in Table I, when the level-2 covariate X2 and the level-3 covariate X3 are ignored in modeling the variance συij2, the standardized bias of α^0 can be as large as 77, and the coverage probability for this parameter drops to around 80%. Also, ignoring the random scale effect and the covariate effects (X1, X2 and X3) on the error variance (σεijk2) modeling, the standardized bias of τ^0 can be as high as 800 and the 95% coverage probabilities in all scenarios drop to 0%. The huge positive standardized biases indicate that the estimate of τ0 on average falls about five standard deviations for small random scale (σω2=0.30), and about eight standard deviations for large random scale (σω2=1.20), above the true parameter. Additionally, the bias, standardized bias and RMSE tend to increase when the random scale variance increases. Our simulations only consider one covariate at each level, thus if the number of covariates at each level increases, the estimated intercepts of level-3, 2 random effects variances and error variance (λ^0, α^0 and τ^0) could be even more biased (if these covariates are ignored in the variance modeling).

7. Application to adolescent mood data

Data from the EMA Adolescent Mood Study is used to illustrate application of the proposed three-level mixed-effects LS model. Here, we focus on the degree to which covariates might explain variation at the subject-, day- and prompt-level in NA and PA, over and above their influence on the mean response. Subject-level (level-3) covariates include Smoker (defined as presence of at least one smoking event during the EMA baseline data collection period, 1 = yes or 0 = no), PropSmk (a proportion which indicates the level of smoking and is defined as the number of smoking events over the total number of random prompts and smoking events), Male (1 = male or 0 = female), Grade10 (1 = 10th or 0 = 9th grade), NovSeekC (a measure of novelty seeking), and NegMoodRegC (a measure of negative mood regulation). Among these covariates, NovSeekC and NegMoodRegC are grand mean centered. Day-level (level-2) covariates include WeekEnd (0 = weekday indicating Monday to Friday or 1 = weekend indicating Saturday and Sunday). For prompt-level (level-1) covariates, we considered whether the subject was alone or accompanied by others (0 = not alone or 1 = alone) at the time of the random prompt. For this variable, we created both BS and WS-WD versions, AloneBS and AloneWS, as described by Neuhaus and Kalbfleisch [25], namely the decomposition Xijk = i.. + (Xijki..). Here, AloneBS = i.. equals the proportion of random prompts in which a subject was alone, and AloneWS = Xijki.. is the prompt-specific deviation from the proportion. Note that AloneBS is a subject-level covariate and AloneWS is a prompt-level covariate.

Results are given in Table II for NA and Table III for PA. For comparison purposes, estimates of a two-level mixed-effects LS model and a three-level random intercept model are also listed. The first column lists the estimates (β^) and standard errors for the random-intercept model; the 2nd to 4th columns, respectively, list the estimates (β^,λ^,τ^) and standard errors for the two-level LS model; and the 5th to 8th columns, respectively, list the estimates (β^,λ^,α^,τ^) and standard errors for the proposed three-level LS model. The variance estimates (λ^,α^,τ^) are on the natural log scale and correspond to the regression parameter estimates for the BS, WS-BD, and WS-WD variances, respectively.

Table II.

Mixed-effects models of Negative Affect, n = 461 and Σijnij=3462 and Σijknijk=14150, maximum likelihood estimates (standard errors)

Random Intercept Mixed-effects Location Scale Model

two-level
three-level
Parameters Mean (β) Mean (β) BS (λ) WS (τ) Mean (β) BS (λ) WS-BD (α) WS-WD (τ)
Intercept 3.096*** (0.200) 3.094*** (0.191) 0.281 (0.215) 0.637*** (0.138) 3.128*** (0.191) 0.227 (0.227) -0.660** (0.206) 0.361* (0.145)
Smoker 0.367* (0.162) 0.399* (0.162) 0.187 (0.156) 0.372*** (0.112) 0.395* (0.160) 0.138 (0.167) 0.572*** (0.144) 0.348** (0.117)
PropSmk -1.060 (0.766) -1.223 (0.750) -0.427 (0.752) -1.266* (0.530) -1.262 (0.731) -0.469 (0.812) -2.413** (0.785) -1.163* (0.561)
NovSeekC 0.183 (0.098) 0.184 (0.097) -0.154 (0.087) 0.221** (0.068) 0.188 (0.097) -0.173 (0.094) 0.259** (0.099) 0.203** (0.071)
NegMoodRegC -0.784*** (0.096) -0.767*** (0.095) -0.239* (0.096) -0.274*** (0.066) -0.759*** (0.094) -0.234* (0.103) -0.730*** (0.095) -0.194** (0.070)
Male -0.408** (0.135) -0.352** (0.130) -0.224 (0.127) -0.361*** (0.093) -0.349** (0.129) -0.264* (0.133) -0.172 (0.136) -0.388*** (0.098)
Grade10 0.091 (0.128) 0.105 (0.125) 0.027 (0.122) -0.069 (0.088) 0.096 (0.124) 0.013 (0.129) 0.059 (0.126) -0.082 (0.093)
AloneBS 0.926** (0.333) 0.771* (0.323) 0.512 (0.311) 0.357 (0.230) 0.776* (0.321) 0.634 (0.337) -0.525 (0.319) 0.531* (0.242)
AloneWS 0.347*** (0.030) 0.166*** (0.021) 0.050 (0.029) 0.165*** (0.021) 0.042 (0.032)
WeekEnd -0.228*** (0.045) -0.102*** (0.020) 0.029 (0.032) -0.202*** (0.036) 0.048 (0.146) -0.006 (0.034)

WS variance of scale σω2 0.801*** (0.058) 0.872*** (0.064)
Covariance σνω 0.520*** (0.061) 0.512*** (0.062)

-2logL 55058 52814 52086
AIC 55084 52874 52164
BIC 55138 52998 52326
***

p < 0.001

**

p < 0.01

*

p < 0.05

Table III.

Mixed-effects models of Positive Affect, n = 461 and Σijnij=3462 and Σijknijk=14150, maximum likelihood estimates (standard errors)

Random Intercept Mixed-effects Location Scale Model

two-level
three-level
Parameters Mean (β) Mean (β) BS (λ) WS (τ) Mean (β) BS (λ) WS-BD (α) WS-WD (τ)
Intercept 7.443*** (0.164) 7.389*** (0.156) -0.268 (0.192) 0.608*** (0.108) 7.385*** (0.156) -0.284 (0.204) -1.123*** (0.240) 0.421*** (0.115)
Smoker -0.133 (0.133) -0.087 (0.128) -0.068 (0.169) 0.144 (0.087) -0.097 (0.128) -0.041 (0.177) 0.636*** (0.167) 0.083 (0.092)
PropSmk -0.267 (0.628) -0.261 (0.624) 0.667 (0.875) -0.574 (0.415) -0.254 (0.628) 0.709 (0.914) -2.753** (0.906) -0.322 (0.439)
NovSeekC 0.103 (0.080) 0.054 (0.080) -0.256** (0.094) 0.131* (0.053) 0.054 (0.081) -0.282** (0.098) 0.244* (0.111) 0.113* (0.056)
NegMoodRegC 0.589*** (0.079) 0.589*** (0.076) -0.092 (0.098) -0.163** (0.052) 0.589*** (0.077) -0.067 (0.102) -0.288** (0.110) -0.143** (0.055)
Male 0.228* (0.111) 0.180 (0.106) -0.146 (0.130) -0.230** (0.073) 0.182 (0.106) -0.176 (0.135) -0.007 (0.148) -0.260*** (0.077)
Grade10 0.036 (0.105) -0.012 (0.102) -0.290* (0.123) -0.146* (0.069) -0.006 (0.102) -0.289* (0.128) -0.181 (0.142) -0.148* (0.073)
AloneBS -1.485*** (0.273) -1.311*** (0.267) 1.145*** (0.319) 0.304 (0.180) -1.314*** (0.267) 1.096** (0.338) -0.269 (0.374) 0.401* (0.191)
AloneWS -0.490*** (0.027) -0.369*** (0.023) 0.053 (0.028) -0.353*** (0.023) 0.041 (0.031)
WeekEnd 0.209*** (0.037) 0.198*** (0.023) -0.073* (0.030) 0.203*** (0.031) -0.162 (0.177) -0.055 (0.033)

WS variance of scale σω2 0.458*** (0.035) 0.506*** (0.039)
Covariance σνω -0.303*** (0.040) -0.315*** (0.042)

-2logL 52093 50560 50077
AIC 52119 50620 50155
BIC 52172 50744 50317
***

p < 0.001

**

p < 0.01

*

p < 0.0

As can be seen from Tables II and III, for both NA and PA, the random scale effects (scale variance and location scale covariance) in the two- and three-level LS models are highly significant (p < 0.001). Both AIC and BIC favor the three-level LS model relative to the two-level LS model, which in turn is favored relative to the three-level random intercept model. This provides clear evidence that the error variance varies across individuals, above and beyond the contribution of the many covariates, and that the three-level LS model outperforms the two-level LS model and both are better than the random intercept model. Also, in terms of the LS covariance, for NA the positive covariance estimate shows that subjects with higher NA mean (poorer mood) fluctuate more in NA, while for PA the negative covariance estimate indicates that subjects with higher PA mean (better mood) vary less across prompts in their PA responses.

In comparing the mean effects among the three models, some differences emerge between the random-intercept and the two mixed-effects LS models. In general, the former model yields a few more significant results than the latter. Specifically, for NA in Table II, the significance level of AloneBS in the random-intercept model (p-value < 0.01) is diminished in the two mixed-effects LS models as noted by the increasing p-values (< 0.05). Similarly, in Table III, the gender effect (Male) that significantly increases the PA mean in the random-intercept model is no longer significant (p-values > 0.05) in the two LS models. However, the differences between the two-level and three-level mixed-effects LS models are not obvious in the sense that the mean estimates from the two LS models are similar in magnitude and significance levels, and the standard errors of the parameter estimates are close. Thus, it would appear that if the main interest centers on changes in the mean, the two-level model works fairly well as compared to the three-level model, and both are superior to the over-simplified random intercept model.

In comparing the two- and three-level LS models, it is observed that most of the differences in variance modeling come from the parameter estimates associated with the error variance (i.e., WS variance in the two-level model and WS-WD variance in the three-level model). These differences arise from the separation of WS-BD and WS-WD variation in the three-level LS model, which are simply treated as error variance (i.e., WS variance) in the two-level model. As can be seen from Table II, for the NA outcome, the variables Smoker, PropSmk and NegMoodRegC that significantly affect WS variance in the two-level model, have greater influence (i.e., smaller p-values) on persons’ between-day variation (i.e., WS-BD variance), and less influence (i.e., larger p-values) on persons’ within-day variation (i.e., WS-WD variance) in the three-level model. The variable Male which has a significant negative effect on WS variance in the two-level model only shows a significant negative effect on within-day variation but not on between-day variation in the three-level model. The non-significant variable AloneBS on WS variance in the two-level model becomes significant in terms of within-day but not between-day variance in the three-level model. The variable NovSeekC, which significantly increases WS variance in the two-level model, has the same significance level on both within- and between-day variations in the three-level model.

Turning to the PA outcome, although currently smoking (Smoker) and the level of smoking (PropSmk) do not significantly affect WS mood variation in the two-level model, they significantly (p-values < 0.01) affect between-day variation, but not within-day variation in the three-level model. The variables NovSeekC and NegMoodRegC that either significantly increase or decrease the WS variance in the two-level model have equal influence (similar significance level) on both between- and within-day variance in the three-level model. The variables Male and Grade10 that have significant negative effect on WS variation in the two-level model only show significant negative effect on within-day variation but not on between-day variation. The non-significant variable AloneBS on the WS variance in the two-level model becomes significant on within-day variation but not on between-day variation in the three-level model; conversely, the significant WeekEnd indicator on WS variance in the two-level model is no longer significant in the three-level model for both between- and within-day variations. Thus, a three-level LS model provides a fuller examination of WS variation; we can more precisely assess where the within-subject variation occurs: either between-days, within-days, or both.

For a regular mixed-effects three-level model, we have several different kinds of Intraclass correlations (ICCs) that are of potential interest as described by Snijders and Bosker [26]. For the proposed three-level mixed-effects LS model, ICC estimates can also be obtained. The ICC at level 3 represents the proportion of total unexplained variation that is at the subject level and is also the correlation for two observations from the same individual on different days and is denoted as σγi2Var(yijk)Var(yijk). The ICC at levels 2 and 3 represents the proportion of total unexplained variation that is at both subject- and day-level, and is also the correlation for two observations from the same individual on the same day. This ICC is denoted as (σγi2+συij2)Var(yijk)Var(yijk). Note that the ICC at either the subject-level or both subject- and day-level can vary as a function of subject-level, day-level and occasion-level covariates. Since the model allows the three variance components to vary as a function of covariates, here for simplicity, we report averaged variances at each level. Using these averaged variances, the ICC at the subject level (level-3) is estimated to be 0.337 for NA and 0.324 for PA, while the ICC at the day and subject level (level-2 and -3) is estimated to be 0.443 for NA and 0.412 for PA. Therefore, of the total (unexplained) variance for NA, 33.7% is at the subject level, while 44.3% is at the day and subject level. Obviously, in terms of NA, there is more difference between subjects than within subjects (and across days), though the latter is not negligible. Similar conclusions apply to the ICCs for PA.

To summarize our findings, in terms of mean response, it is noted that several variables significantly increase (Smoker, AloneBS, AloneWS), and decrease (NegMoodRegC, Male, WeekEnd) the mean level of NA. Thus, being a smoker and a loner (i.e., higher on AloneBS) as well as being alone (i.e., higher on AloneWS) increase NA. Conversely, being a male and having better negative mood regulation (i.e., higher on NegMoodRegC) decrease NA. NA is also higher on weekdays and lower at weekends. Turning to PA, we found similar effects to those for NA (but in the opposite direction). Namely, the variables (NegMoodRegC, WeekEnd) significantly increase, whereas the variables variables (AloneBS, AloneWS) significantly decrease this mean. Thus, being a loner as well as being alone lower PA. Conversely, having better negative mood regulation increases PA. Also, PA is increased for weekends and decreased on weekdays. Turning to the covariate effects on the variances, in terms of BS variation, males and those with better negative mood regulation have less subject to subject NA variation and behave more homogeneously. Also, novelty seekers and 10th graders exhibit less PA variation, while loners have more PA variation. In terms of within-subjects day-to-day variation, all of the results observed for NA are also seen for PA. Namely, smokers and novelty seekers are more varied and less homogeneous from day to day, whereas negative mood regulators (i.e., higher on NegMoodRegC) and smokers with higher smoking levels (i.e., higher on PropSmk) vary less and behave more homogeneous in both NA and PA from day to day. As to WS-WD variation, several variables significantly increase this variance (Smoker, NovSeekC, AloneBS), whereas others significantly diminish this variance (PropSmk, NegMoodRegC, Male) for NA. Thus, for NA the WS-WD data are more varied from smokers, novelty seekers, and loners, and less varied from males, negative mood regulators, and smokers with higher smoking levels. Similarly results were observed to PA, namely, the variables NovSeekC and AloneBS significantly increase this variance, while NegMoodRegC and Male significantly decrease this variance. In addition, 10th graders decrease WS-WD PA variance.

8. Discussion

In this article we have extended an existing two-level mixed-effects LS model proposed by Hedeker et al. [12] to three levels by adding an intermediate day level into the two-level structure (occasions nested within subjects) to account for within-subjects day-to-day mood variation in EMA data. The proposed three-level mixed-effects LS model therefore is based on a conventional three-level random intercept model, but allows covariates to influence the variances at the subject, day and occasion levels. This model can examine the degree to which subjects are heterogeneous in terms of their mood variation by further including a subject-level random scale effect on the WS-WD variance. Our examples with NA and PA clearly show that subjects experience systematic mood variation from day to day as well as within days. In this article we also detailed how maximum likelihood estimation can be carried out using existing software (SAS PROC NLMIXED).

The methods developed in this article can easily generalize to a variety of EMA studies in smoking and cancer-relevant research areas, such as studying the relapse among adolescent smokers [27], examining the urge to smoke [28] in the former; and the assessment of pain and symptoms, as well as diet and exercise in the latter. As EMA studies typically involve many measurements obtained from subjects both within and across days, the three-level mixed-effects LS model would seem to be a useful tool for analysis of EMA data. Additionally, although the proposed model was developed for analysis of an EMA dataset, the model can also be applied to other types of studies with three-level structures when the study interest involves covariate effects on the variances as well as the overall mean.

In this article, single random effects at each of the subject- and day-levels were considered, but this could be generalized, for example, to allow random intercepts and trends. Specifically, we can generalize Equation (1) to allow covariates to influence multiple BS variance parameters (i.e., intercept and slope variances), multiple WS-BD variance parameters (i.e., intercept and slope variances), as well as the WS-WD variance, using a log-linear representation.

Modern data collection procedures, such as EMA, usually provide a fair amount of data, and so give rise to the opportunity for modeling of variances as a function of covariates. One might wonder about how many subjects and observations within subject data are necessary for estimation and variance modeling purposes. For random coefficient models, Longford [30] noted the difficulty with providing general guidelines about the degree of complexity, for the variation part of a model that a given dataset could support. This would also seem to be true here. Simulations with small sample sizes (e.g., 20 subjects with 5 observations each), gives the general impression that the main concern is that the algorithm does not often converge, but instead has estimation difficulties of one sort or another, in small sample situations.

The current work focuses on continuous outcomes. Further work could extend our 3-level model to other types of outcomes such as binary or ordinal. For such outcomes, two-level mixed LS models for ordinal data are described by Hedeker et al. [11] and [29], while Gibbons and Hedeker [21] and Raman and Hedeker [22] describe (random intercept) three-level mixed models for dichotomous and ordinal outcomes, respectively. Therefore, a future aim is to extend these approaches to develop a 3-level mixed LS model for such categorical outcomes.

Our work here only considers a frequentist approach. Alternatively one could use a Bayesian approach, via Markov chain Monte Carlo (MCMC), for estimation of the hierarchical variance components. A recent article describing a two-level model using a Bayesian approach is in Myles et al [31].

Finally, it should be mentioned that affect levels, and variability in affect levels, could be influenced by other variables than those presented in example of this paper. We included variables that were deemed to be “good candidates,” but we have not been exhaustive in our selection of covariates. Essentially, we feel that our example provides a reasonable approach for illustrating our statistical model, but certainly more work could be done to provide a more comprehensive modeling of mood variation. Also, there are other methodological approaches for modeling variance, for example work on linear oscillators (Deboeck [32]; Oertzen & Boker, [33]), typology clustering (Norman et al., [34]), and generalized mixed models (Jahng et al., [35]). Future work could compare the relative merits of these approaches.

Supplementary Material

3

Acknowledgements

This work was supported by National Cancer Institute grants 5PO1 CA98262 and R21 CA140696. The authors would like to thank Professor Robin Mermelstein for use of the example data.

References

  • 1.Stone A, Shiffman S. Ecological Momentary Assessment (EMA) in behavioral medicine. Annals of Behavioral Medicine. 1994;16:199–202. [Google Scholar]
  • 2.Smyth JM, Stone AA. Ecological momentary assessment research in behavioral medicine. Journal of Happiness Studies. 2003;4:35–52. [Google Scholar]
  • 3.De Vries M. The experience of psychopathology: Investigating mental disorders in their natural settings. Cambridge University Press; New York: 1992. [Google Scholar]
  • 4.Bolger N, Davis A, Rafaeli E. Diary methods: capturing life as it is lived. Annual Review of Psychology. 2003;54:579–616. doi: 10.1146/annurev.psych.54.101601.145030. [DOI] [PubMed] [Google Scholar]
  • 5.Walls TA, Schafer JL. Models for intensive longitudinal data. Oxford University Press; New York: 2006. [Google Scholar]
  • 6.Schwartz JE, Stone A. The analysis of real-time momentary data: A practical guide. In: Stone AA, Shiffman SS, Atienza A, Nebeling L, editors. The science of real-time data capture: Self-report in health research. Oxford University Press; Oxford, England: 2007. [Google Scholar]
  • 7.Cleveland WS, Denby L, Liu C. Random scale effects. Technical report, Bell Lab. 2002 http://cm.bell-labs.com/cm/ms/departments/sia/wsc/webpapers.html.
  • 8.Cleveland WS, Denby L, Liu C. Random location and scale effects: model building methods for a general class of models. Computing Science and Statistics. 2002;32:3–10. [Google Scholar]
  • 9.Hedeker D, Mermelstein RJ. Mixed-effects regression models with heterogeneous variance: Analyzing ecological momentary assessment data of smoking. In: Little TD, Bovaird JA, Card NA, editors. Modeling Contextual Effects in Longitudinal Studies. Lawrence Erlbaum Associates; Mahwah, NJ: 2007. pp. 183–206. [Google Scholar]
  • 10.Hedeker D, Berbaum M, Mermelstein R. Location-scale models for multilevel ordinal data: Between- and within-subjects variance modeling. Journal of Probability and Statistical Science. 2006;4:1–20. [Google Scholar]
  • 11.Hedeker D, Demirtas H, Mermelstein RJ. A mixed ordinal location scale model for analysis of Ecological Momentary Assessment (EMA) data. Statistics and its Interface. 2009;2:391–401. doi: 10.4310/sii.2009.v2.n4.a1. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 12.Hedeker D, Mermelstein RJ, Demirtas H. An application of a mixed-effects location scale model for analysis of ecological momentary assessment (EMA) data. Biometrics. 2008;64:627–634. doi: 10.1111/j.1541-0420.2007.00924.x. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 13.Harvey AC. Estimating regression models with multiplicative heteroscedasticity. Econometrica. 1976;44:461–465. [Google Scholar]
  • 14.Aitkin M. Modeling variance heterogeneity in normal regression using GLIM. Applied Statistics. 1987;22:332–339. [Google Scholar]
  • 15.Fowler K, Whitlock MC. The distribution of phenotypic variance with inbreeding. Evolution. 1999;53:1143–1156. doi: 10.1111/j.1558-5646.1999.tb04528.x. [DOI] [PubMed] [Google Scholar]
  • 16.Leonard T. A Bayesian approach to the linear model with unequal variances. Technometrics. 1975;17:95–102. [Google Scholar]
  • 17.Ren`o R, Rizza R. Is volatility lognormal? Evidence from Italian futures. Physica A: Statistical Mechanics and its Applications. 2003;322:620–628. [Google Scholar]
  • 18.Shenk TM, White GC, Burnhamb KP. Sampling-variance effects on detecting density dependence from temporal trends in natural populations. Ecological Monographs. 1998;68:445–463. [Google Scholar]
  • 19.Vasseur H. Prediction of tropospheric scintillation on satellite links from radiosonde data. IEEE Transactions on Antennas and Propagation. 1999;47:293–301. [Google Scholar]
  • 20.Berndt E, Hall B, Hall R, Hausman J. Estimation and inference in nonlinear structural models. Annals of Economic and Social Measurement. 1974;3:653–665. [Google Scholar]
  • 21.Gibbons RD, Hedeker D. Random effects probit and logistic regression models for three-level data. Biometrics. 1997;53:1527–1537. [PubMed] [Google Scholar]
  • 22.Raman R, Hedeker D. A mixed-effects regression model for three-level ordinal response data. Statistics in Medicine. 2005;24:3331–3345. doi: 10.1002/sim.2186. [DOI] [PubMed] [Google Scholar]
  • 23.Gueorguieva RV. Comments about joint modeling of cluster size and binary and continuous subunit-specific outcomes. Biometrics. 2005;61:862–867. doi: 10.1111/j.1541-020X.2005.00409_1.x. [DOI] [PubMed] [Google Scholar]
  • 24.Demirtas H. Simulation-driven inferences for multiply imputed longitudinal datasets. Statistica Neerlandica. 2004;58:466–482. [Google Scholar]
  • 25.Neuhaus JM, Kalbfeisch JD. Between- and within-cluster covariate effects in the analysis of clustered data. Biometrics. 1998;54:638–645. [PubMed] [Google Scholar]
  • 26.Snijders T, Bosker R. Thousand Oaks; California: 1999. pp. 65–66. [Google Scholar]
  • 27.Gwaltney CJ, Bartolomei R, Colby SM, Kahler CW. Ecological momentary assessment of adolescent smoking cessation: A feasibility study. Nicotine & Tobacco Research. 2008;10:1185–1190. doi: 10.1080/14622200802163118. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 28.O'Connell KA, Gerkovich MM, Cook MR, Shiffman S, Hickcox M, Kakolewski KE. Coping in real time: Using ecological momentary assessment techniques to assess coping with the urge to smoke. Research in Nursing & Health. 1998;21:487–497. doi: 10.1002/(sici)1098-240x(199812)21:6<487::aid-nur3>3.0.co;2-g. [DOI] [PubMed] [Google Scholar]
  • 29.Hedeker D, Mermelstein RJ, Berbaum ML, Campbell RT. Modeling mood variation associated with smoking: an application of heterogeneous mixed-effects model for analysis of ecological momentary assessment (EMA) data. Addiction. 2009;104:297–307. doi: 10.1111/j.1360-0443.2008.02435.x. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 30.Longford N. Random Coefficient Models. Clarendon Press; Oxford, UK: 1993. [Google Scholar]
  • 31.Myles JP, Price GM, Hunter N, Day M, Duffy SW. A potentially useful distribution model for dietary intake data. Public Health Nutrition. 2003;6(5):513–519. doi: 10.1079/PHN2003459. [DOI] [PubMed] [Google Scholar]
  • 32.Deboeck PR. Estimating dynamical systems: Derivative estimation hints from Sir Ronald A. Fisher. Multivariate Behavioral Research. 2010;45:725–745. doi: 10.1080/00273171.2010.498294. [DOI] [PubMed] [Google Scholar]
  • 33.Oertzen T, Boker SM. Time delay embedding increases estimation precision of models of intraindividual variability. Psychometrika. 2010;75:158–175. doi: 10.1007/S11336-009-9137-9. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 34.Norman GJ, Velicer WF, Fava JL, Prochaska JO. Dynamic typology clustering within the stages of change for smoking cessation. Addictive Behaviors. 1998;23:139–153. doi: 10.1016/s0306-4603(97)00039-7. [DOI] [PubMed] [Google Scholar]
  • 35.Jahng S, Wood PK, Trull TJ. Analysis of affective instability in EMA: Indices using successive difference and group comparison via multilevel modeling. Psychological Methods. 2008;13:345–375. doi: 10.1037/a0014173. [DOI] [PubMed] [Google Scholar]

Associated Data

This section collects any data citations, data availability statements, or supplementary materials included in this article.

Supplementary Materials

3

RESOURCES