The collection of time use data is central to understanding many facets of human life. In the United States, for example, the Department of Labor supports the collection of time use data across a wide range of domains to conduct economic research, understand health, safety, and family and work-life balance, and make international comparisons. Time use data may be obtained for a single occasion in a target population, such as time devoted by students to academic study (Mucciardi, 2013), or for multiple time points to understand patterns of change in behaviors over time, such as how children's time spent with their parents changes over time (Sandberg & Hofferth, 2001).

Arguably, the manner in which time use is measured is a complex research enterprise, and the subsequent data analysis can present challenges. Here we consider longitudinal time use data that are measured using a semicontinuous scale with zero indicating that an individual did not engage in the behavior and values being positive otherwise. Importantly, we assume that there is interest in understanding correlates of the likelihood that an individual will engage in the behavior, and separate from this, interest in understanding correlates of the extent to which an individual engages in the behavior conditional on any time being spent, as well as the within-subject variation in time spent about an individual’s conditional mean time across occasions. We assume that for each measurement occasion, respondents are asked to report time spent engaged in a behavior over a specified period of time, such as time spent on a task or engaged in an activity within a 24-hour period, and the question asked daily across multiple days. We assume a direct correspondence between each period that defines an occasion (e.g., a 24-hour period) and the period during which an individual decides to engage in the behavior (i.e., the same 24-hour period).

Daily diary of time spent relaxing, engaging in leisure activities

The National Study of Daily Experiences (NSDE) (Almeida, 2007) was designed to study time spent in various daily activities considered stressful to people. A sample of 1031 adults of the NSDE (excluding a subsample of twins and siblings) was randomly sampled from the Midlife in the United States (MIDUS) study. Interviews for the NSDE were conducted between March 1996 and April 1997. For the sample studied here, participants (54.4% women) were 47.4 years of age on average (SD = 13.2) and ranged in age from 20 to 74 years. The goal of the NSDE was to conduct telephone interviews to obtain self-reports of daily experiences over 8 consecutive days. The starting day (i.e., the day of the week) of the interview period varied between participants. The mean number of interview days for this sample was 7.0 (SD = 1.4, minimum = 1, maximum = 8).

We consider the daily measures of time spent relaxing or engaged in leisure activities, where a single question was used in the survey to pertain to these types of activities collectively. The proportions of the sample engaged in these activities by day of the week are summarized in Table 1, along with the means, standard deviations, and minimums and maximums of time spent in hours, conditional on any time being spent. Fig. 1 displays boxplots of the hours spent each day conditional on any amount of time being spent.

Table 1 Descriptive statistics for relaxing/leisure activities (n = 1031)
Fig. 1
figure 1

Boxplots of positive reports of daily leisure time by day of week (n = 1031)

Key features of the data are worth noting. For each day, scores are positively skewed, with a subset of individuals reporting no time spent engaged in leisure activities. When individuals were engaged, the reported daily time spent varied between individuals, with relatively few individuals reporting high amounts of time spent, as evidenced by the positive skew in the daily response distributions displayed in Fig. 1. In addition to the information provided in Table 1 and Fig. 1, individuals differed in their activities across days. At the individual level, the proportion of survey days that an individual reported engaging in leisure activities ranged from 0 to 1, indicating that some individuals reported no days of leisure activities and some reported leisure activities for all survey days. The daily mean time that individuals were engaged ranged from 0.33 to 23.8 hours, indicating a wide range in activity levels. Again at the individual level, the standard deviation of daily time measures when engaged ranged from 0 to 10.7, with some individuals having relative stability in their responses across days and others not. To capture these features of the data and allow for their study, a model is needed that can (1) distinguish between a response of zero and a positive report of time spent, and thus characterize the likelihood that an individual will engage in the activity, and (2) characterize time spent conditional on an individual engaging in the activity, addressing the day-to-day variation in time spent that differs between individuals as well. As two-part mixed-effects models have been successful in addressing key features of data similar to these, we build upon this modeling framework for the analysis of time use data. These models and their extensions are described next.

Two-part models for semicontinuous time use data

Two-part models (Cragg, 1971) are useful for the analysis of time use data with many zeros from cross-sectional studies, and may be preferred to other models. These models rely on the creation of two variables from the original response: A binary variable represents whether an individual engaged in the behavior, and a continuous variable represents the time spent conditional on any time being spent. Analysis of the two variables is done independently, such as by applying a logistic regression model to the binary response and a linear regression model to the conditional continuous response (Duan, Manning, Morris, & Newhouse, 1983). Tobit regression has been used for time use measures with many zeros, but the method assumes left- or right-censoring of the response. Values below zero are not possible, however, and so the assumption of left-censoring is deemed inappropriate. Further, Tobit regression is not naturally set up to allow for different predictors to relate to the likelihood that one engages in a behavior and the degree of engagement (Stewart, 2013). Standard linear regression has also been applied to time use data that include zeros (Cawley & Liu, 2012), but this approach also cannot be used to make unique predictions about the likelihood of engaging in the behavior and the conditional degree of engagement, in addition to making no particular accommodation for zeros. Indeed, the goals of the data analysis need to be carefully considered when selecting a statistical framework for analysis.

Two-part mixed-effects models

A two-part mixed-effects model extends a two-part model for application to repeated measures of a semicontinuous variable, and thus provides an appealing approach to the analysis of repeated measures of time use data. Under the model, each model part includes one or more random effects to account for within-subject dependencies in the data. Olsen and Schafer (2001) and Tooze, Grunwald, and Jones (2002) describe a model based on a joint distribution linking separate mixed-effects models for a binary and a continuous response. The two models are linked by covariances between their respective random effects, and as a result, estimation of the two model parts is simultaneous. These models are flexible in that different response distributions may be used to represent each model part (e.g., Liu, Cowen, Strawderman, & Shih, 2010). This can be particularly important for time use data, which in addition to typically including many zeros, are commonly positively skewed. Importantly, these models retain the ability to use different covariates to predict engagement in a behavior and the level of engagement conditional on any positive level of engagement.

Two-part mixed-effects models share features common to mixed-effects models more generally. For example, the models do not require complete data, and data are assumed to be missing at random. A general form of the model is assumed to apply to all members of a population with one or more of the coefficients of each model part being subject-specific. The covariance structure is separated into a within- and a between-subject component. The within-subject covariance structure describes the variation and possible covariation of scores between occasions. The between-subject covariance structure describes the variation and possible covariation of the random effects that are used to characterize the repeated response measures. Maximum likelihood (ML) (Olsen & Schafer, 2001) or Bayesian estimation (Xing et al. 2017) may be used for estimation of these models.

Using daily diary data from a large study of daily stressors in adults, we show how these models may be formulated to study between-subject differences and within-individual variability in semicontinuous data by relaxing some of the assumptions typically made when applying these models. It is common in applications of two-part mixed-effects models to assume homogeneity of variance of a random coefficient across subjects and of the variance of the occasion-level residual across occasions and subjects. To relax both of these assumptions, we incorporate features of a mixed-effects location scale model (Hedeker, Mermelstein, & Demirtas, 2008; Hedeker & Nordgren, 2013) into a two-part mixed-effects model. A mixed-effects location scale model is a model for a single normally distributed variable that includes a sub-model for the variance of a random intercept so that it can depend on within- and between-subject covariates, in addition to a sub-model for the variance of the occasion-level residual so that it can depend on within- and between-subject covariates. Additionally, the model for the variance of the occasion-level residual can include a random subject effect to allow between-subject heterogeneity of variance even after adjusting for covariates.

Analytical strategy

In analyzing data from the NSDE, we assumed that respondents had an opportunity each day to engage in relaxing or leisure activities and that a choice was made each day to engage or not engage in such activities. We began by fitting a set of unconditional models in which the response distribution of the continuous model part was assumed to follow one of three distributions: normal, log-normal or gamma distribution. The latter two distributions are positive and continuous distributions that may be well suited to addressing the positive skew observed in the positive time use responses. Using the best-fitting of these three models, covariates were added to the model under three different model formulations. First, a two-part mixed-effects model was applied in the usual way to study the log odds of engagement and the daily mean time when engaged. An extended model was then developed to include the study of possible heterogeneity in both the within- and the between-subject covariance structures. This permitted us to study any day-to-day variation in time spent about an individual’s mean time when engaged and any between-subject variation in the individual log odds and daily mean time, both after adjusting for the effects of model covariates that entered the mean structure of the model. This extended model was then reduced by evaluating the need for particular covariates. Fixed effects were evaluated using likelihood ratio tests with a significance level of .05. Interpretation of the three models that include covariates is delayed until after the models are developed and estimates provided.

PROC NLMIXED for SAS version 9.4 software was used to carry out the analyses. The process of fitting a mixed-effects model to complex data can be a challenge. The paper by Kiernan, Tao, and Gibbs (2012) addresses issues for fitting linear and nonlinear mixed-effects models in SAS, and we relied on many of the suggestions provided in their paper—for example, providing reasonable starting values, and beginning with relatively simple models and building up a model by increasing its complexity. For the empirical analyses presented here, we began by fitting fixed effects models and gradually built up the model by increasing the complexity (e.g., adding random effects), while updating the starting values for each model based on estimates obtained by simpler versions of the model. As we added new parameters to the model, we used what we thought were reasonable starting values. With regard to estimation procedures, SAS PROC NLMIXED includes a few options. We found that using nonadaptive Gaussian quadrature, as opposed to the default method of adaptive Gaussian quadrature, was best for obtaining a solution. Taking guidance from a simulation study by Carlin, Wolfe, Brown, and Gelman (2001), we used nonadaptive Gaussian quadrature with a high number (20) of quadrature points.

Unconditional models for daily leisure time activity data

We began by fitting an unconditional two-part mixed-effects model to the data. Let yij be the observed response for individual i on day j, where i = 1,..., N and j = 1,..., ni, with N denoting the total number of subjects and ni the number of survey days for individual i. Let tij be the day that yij was observed. From yij two new variables were created: uij = 1 if yij > 0 and uij = 0 if yij = 0 (if yij was missing, then uij was set to missing); mij = yij if yij > 0 and was missing otherwise. Next, let ηij be the logit of the individual engaged in the activity:

$$ {\upeta}_{\mathrm{ij}}=\log \left[\mathrm{P}\left({u}_{\mathrm{ij}}=1\right)/\left(1-\mathrm{P}\left({u}_{\mathrm{ij}}=1\right)\right)\right] $$
(1)

The logit in Eq. (1) was assume to follow a mixed-effects model:

$$ {\upeta}_{\mathrm{ij}}={\alpha}_0+{a}_i $$
(2)

where α0 is the mean logit and ai is a random subject effect assumed to be independent and identically distributed (i.i.d.) across subjects as normal with mean equal to 0 and variance \( {\upvarphi}_a^2 \). The variance parameter \( {\upvarphi}_a^2 \) characterizes between-subject variation in the logit.

A positive report of time spent was modeled using a linear mixed-effects model:

$$ {m}_{ij}={\gamma}_0+{b}_i+{\varepsilon}_{ij} $$
(3)

where γ0 is the mean time spent and bi is a random subject effect assumed to be i.i.d. normal across subjects with mean equal to 0 and variance \( {\upvarphi}_b^2 \). The variance \( {\upvarphi}_b^2 \) represents between-subject variability in the individual mean times. The residual εij is the day- and individual-specific part of the daily response not accounted for by the subject-specific model given by γ0 + bi. Across days, the set of residuals εi = (εi1,...,\( {\varepsilon}_{i{n}_{\mathrm{i}}} \))′ was assumed to be i.i.d. normal (with the assumption of normality relaxed later) across subjects with mean equal to 0 and covariance matrix Θε. The residuals were assumed to be independent between days with constant variance: Θε = \( {\upsigma}_{\varepsilon}^2 \)Ini, where \( {\upsigma}_{\varepsilon}^2 \) was a common variance and I was an identity matrix of order ni. Initially, the residual covariance structure was assumed to be homogeneous across individuals, but the dimensions of Θε could differ between individuals due to missing data.

The two sub-models for ηij in Eq. (2) and mij in Eq. (3) were joined at the second level by a covariance between the random effects, ai and bi, of the two models:

$$ \boldsymbol{\Phi} =\left[\begin{array}{cc}{\upvarphi}_a^2& \\ {}{\upvarphi}_{ba}& {\upvarphi}_b^2\end{array}\right] $$

where the covariance φba represents the linear relationship between the individual-level logit and mean time spent across days. For instance, a positive covariance would indicate that higher log odds (or likelihood) of engaging in the activity corresponds to a higher daily mean time when engaged in the activity.

To investigate the shape of the response distribution of mij, three versions of the two-part mixed-effects model were fit to the data. In Model A1, mij was assumed to be normally distributedFootnote 1. Although mij is strictly positive, if the responses are bell-shaped, then a normal distribution could provide a suitable approximation to the response distribution. Alternatively, if responses are positively skewed, as expected if increasingly fewer individuals engaged in the behavior to a greater extent, then a log-normal or gamma distribution, both of which are positive and continuous distributions, may approximate the distribution. Model A2 assumed that mij was log-normally distributed and Model A3 assumed that mij followed a gamma distribution. The upper part of Table 2 includes the -2lnL, AIC and BIC values for Models A1–A3. The model that assumed a log-normal distribution for mij (Model A2) provided the best overall fit, based on the model having the lowest AIC (or one could use the BIC for an equivalent conclusion) value. This model was provisionally accepted as the best-fitting unconditional model. From this model, the estimated fixed effect of the logit was 3.2 (SE = 0.10), and the estimated mean log time spent was 0.93 (SE = 0.02). The estimated variance of the random intercept of the logit model was 2.98, and that of the log-normal model was 0.24. The estimated variance of the residual of the log-normal model was 0.39. Under the logistic model, the estimated intraclass correlation coefficient was \( \hat{\rho} \) = 2.98/((π2/3)+2.98) = .48, and that for the log-normal model was \( \hat{\rho} \)= 0.24/(0.39+0.24) = .39, although it should be noted that both estimates assume homogeneity of variance across individuals and measurement occasions. In both model parts, an appreciable portion of the variation in responses is due to both within- and between-subject differences.

Table 2 Indices of model fit of two-part mixed models (n = 1031)

Conditional models for daily leisure time activity data

Covariates were used to study reported time spent engaged in leisure activities. The covariates were as follows: Agei (centered to the sample mean age of 47.4 years), gender (coded as Femi = 1 if female and Femi = 0 if male), and whether the survey took place on a weekday or weekend (Dayij was coded as 1 = Saturday or Sunday and 0 = Monday, Tuesday, Wednesday, Thursday or Friday). Dayij was centered about the person’s proportion of survey days that fell on a weekend, and the proportion of weekend days (PropDayi) was included to statistically adjust for between-subject differences. The number of survey days that fell on a weekend ranged from 0 to 3 across respondents, with a mean of 1.7 and standard deviation of 0.6; corresponding to this, the mean proportion of survey days falling on a weekend was .23 (SD = .08, minimum = 0, maximum = .67).

The first model fit to the data, henceforth called Model B1, represents a typical application of a two-part mixed-effects model. To include covariates, the model for the logit in Eq. (2) was extended:

$$ {\upeta}_{\mathrm{i}\mathrm{j}}={\alpha}_0+{\alpha}_1{Day}_{\mathrm{i}\mathrm{j}}+{\alpha}_2{Fem}_{\mathrm{i}}+{\alpha}_3{Ag\mathrm{e}}_{\mathrm{i}}+{\alpha}_4{Day}_{\mathrm{i}\mathrm{j}}\ast {Fem}_{\mathrm{i}}+{\alpha}_5{Day}_{\mathrm{i}\mathrm{j}}\ast { Ag e}_{\mathrm{i}}+{\alpha}_6{Fem}_{\mathrm{i}}\ast { Ag e}_{\mathrm{i}}+{\alpha}_7{Day}_{\mathrm{i}}\ast { Ag e}_{\mathrm{i}}\ast {Fem}_{\mathrm{i}}+{\alpha}_8{PropDay}_{\mathrm{i}}+{a}_{\mathrm{i}} $$
(4)

where α0 is the logit when all covariates are equal to 0, the coefficients α1, α2 and α3 are the effects of Dayij, Femi and Agei, each conditional on the interacting covariates being equal to 0, the coefficients α4, α5, and α6 are the two-way interaction effects, each also conditional on the interacting covariates being equal to 0, and α7 is the three-way interaction effect between the three covariates. Finally, α8 is the effect of PropDayi conditional on all other covariates. The model includes a random subject effect ai assumed to be i.i.d. normal across subjects with mean equal to 0 and variance \( {\upvarphi}_a^2 \). The variance \( {\upvarphi}_a^2 \) characterizes between-subject variation in the logit after accounting for variation due to covariates and their interactions. Under a mixed-effects logistic regression model, the effects in (4) control for the random subject effect ai (Neuhaus, Kalbfleisch, & Hauck, 1991).

The model for the log of the positive measure of time spent in Eq. (3) was extended:

$$ \log \left(m\mathrm{ij}\right)={\gamma}_0+{\gamma}_1{Day}_{\mathrm{i}\mathrm{j}}+{\gamma}_2{Fem}_{\mathrm{i}}+{\gamma}_3{Age}_{\mathrm{i}}+{\gamma}_4{Day}_{\mathrm{i}\mathrm{j}}\kern0.5em \ast \kern0.5em {Fem}_{\mathrm{i}}+\kern0.5em {\gamma}_5{Day}_{\mathrm{i}\mathrm{j}}\kern0.5em \ast \kern0.5em {Age}_{\mathrm{i}}+{\boldsymbol{\gamma}}_{\mathbf{6}}{Fem}_{\mathrm{i}}\kern0.5em \ast \kern0.5em {Age}_{\mathrm{i}}+{\boldsymbol{\gamma}}_{\mathbf{7}}{Day}_{\mathrm{i}}\kern0.5em \ast \kern0.5em {Age}_{\mathrm{i}}\kern0.5em \ast {Fem}_{\mathrm{i}}+{\boldsymbol{\gamma}}_{\mathbf{8}}{PropDay}_{\mathrm{i}}+{\mathrm{b}}_{\mathrm{i}}+{\upvarepsilon}_{\mathrm{i}\mathrm{j}} $$
(5)

where γ0 is the mean log time when all covariates are equal to 0, the coefficients γ1, γ2 and γ3 are the effects of Dayij, Femi and Agei, each conditional on the interacting covariates being equal to 0, and the coefficients γ4, γ5 and γ6 are the effects of the two-way interactions between the three covariates, also conditional on the interacting covariates being equal to 0. The last coefficient, γ8, is the effect of PropDayi conditional on all other covariates. The model includes a random subject effect bi assumed to be i.i.d. normal across subjects with mean equal to 0 and variance \( {\upvarphi}_b^2 \). The variance \( {\upvarphi}_b^2 \) represents between-subject variation in the individual means in log time after accounting for variation due to covariates and their interactions.

The residual εij in Eq. (5) is the part of the response not accounted for by the subject-specific model that now includes covariates. The residuals were assumed to be i.i.d. log-normal across subjects with mean equal to 0 and covariance matrix Θε. The residuals were again assumed to be independent between days with constant variance. As was done for the unconditional model, the two sub-models for ηij in Eq. (4) and mij in Eq. (5) were joined at the second level by a covariance between the random effects, ai and bi, with both ai and bi now conditional on the covariates. Thus, the variances of ai and bi and their covariance are now the variances and covariance of the random effects conditional on covariates.

ML estimates of the fixed effects of Model B1 are shown in the first column of results in Table 3. ML estimates of the common variance \( {\sigma}_{\varepsilon}^2 \) and the variances and covariance (and corresponding correlation) of the random effects ai and bi are in the first column of results in Table 4. Using a deviance test, the difference in fit between Models A2 and B1 was statistically significant (χ²(16) = 835, P < .0001), indicating an improvement in model fit after the addition of the covariates to predict the logit and log time spent (see Table 2). As stated previously, we delay model interpretation until all three models have been reported.

Table 3 ML estimates of fixed effects (n = 1031)
Table 4 ML estimates of within- and between-covariance structures (n = 1031)

Extended model

Model B1 represents a typical application of a two-part mixed-effects model in which the model assumes homogeneity of the within- and between-subject covariance structures. In Model B2, the model is extended to allow for heterogeneity in both covariance structures. First, the within-subject variance \( {\sigma}_{\varepsilon}^2 \) is allowed to vary according to both within- and between-subject covariates. That is, the variance is a function of variables that are measured daily along with the response variable and those that are subject-specific. This is useful in situations in which heterogeneity of variance is related to covariates. Particularly for time use measures, characterizing individual differences in daily variation in a behavior may be an important element to better understanding time use. The model for the within-subject variance also includes a random subject effect so that, even after adjusting for the effects of covariates, the variance may differ between subjects. The inclusion of a random subject effect can be useful if, for example, additional sources of heterogeneity of variance are unknown. Second, the between-subject covariance structure is allowed to vary according to between-subject covariates. That is, the variance of each random effect is a function of subject-specific covariates. For instance, whereas Model B1 assumes homogeneity of the variances of the intercepts of both the logit and log-normal models, Model B2 permits the variances to depend on Femi and Agei, as described later.

Within-subject heterogeneity

Under Model B1, the residual variance of the continuous model part \( {\sigma}_{\varepsilon}^2 \) was assumed to be homogeneous such that variation in an individual's observed scores about their respective average response across days was the same across days and individuals. Under Model B2, the assumption of homogeneity of variance across days and individuals was relaxed by allowing the residual variance to be predicted by covariates. This allowed us to study whether the covariates accounted for variation in the residual variance beyond what the covariates could account for in predicting an individual's daily time spent engaged in leisure activities. Additionally, a random subject effect was added to the variance model to test whether between-subject heterogeneity of the within-subject variation remained after accounting for the effects of the covariates on the residual variance. The model for the variance \( {\sigma}_{\varepsilon i}^2 \), that now includes subscripts to show that it can vary according to both daily and subject-level covariates, is given by

$$ {\sigma}_{\varepsilon i}^2=\exp \left({\tau}_0+{\tau}_1{Day}_{\mathrm{i}\mathrm{j}}+{\tau}_2{Fem}_{\mathrm{i}}+{\tau}_3{Age}_{\mathrm{i}}+{\tau}_4{Day}_{\mathrm{i}\mathrm{j}}\ast {Fem}_{\mathrm{i}}+{\tau}_5{Day}_{\mathrm{i}\mathrm{j}}\ast {Age}_{\mathrm{i}}+{\boldsymbol{\tau}}_{\mathbf{6}}{Fem}_{\mathrm{i}}\ast {Age}_{\mathrm{i}}+{\tau}_7{Day}_{\mathrm{i}}\ast {Age}_{\mathrm{i}}\ast {Fem}_{\mathrm{i}}+{\tau}_8{PropDay}_{\mathrm{i}}+{\mathrm{w}}_{\mathrm{i}}\right) $$
(6)

where τ0, when exponentiated, is the common (geometric) residual variance when the covariates are equal to zero and wi = 0. For any of the effects τ1τ8, a positive value indicates that an increase in a covariate corresponds to an increase in the variance, and a negative value indicates that an increase in a covariate corresponds to a decrease in the variance. Additionally, the model for the variance in Eq. (6) includes a random subject effect wi that may covary with the other subject-level random effects at the second level of the model:

$$ \boldsymbol{\Phi} =\left[\begin{array}{ccc}{\upvarphi}_a^2& & \\ {}{\upvarphi}_{ba}& {\upvarphi}_b^2& \\ {}{\upvarphi}_{wa}& {\upvarphi}_{wb}& {\upvarphi}_w^2\end{array}\right] $$

where φwa and φwb are the covariances between the random subject effect of the within-subject variance model in (6) and the random effects of the logistic model in Eq. (4) and linear model in Eq. (5), respectively, and \( {\upvarphi}_w^2 \) is the variance of the random subject effect of the within-subject variance model in (6). The covariances φwa and φwb represent the linear relationships between the individual-level logits and individual mean log time measures with the random effect of the within-subject variance model in (6). Positive covariances would indicate that as either the logit or mean time spent increases, there is a corresponding increase in the daily variation in time spent about an individual’s mean log time. Negative covariances would indicate that as either the logit or mean log time increases, there is a corresponding decrease in the daily variation in time about an individual’s mean log time.

Between-subject heterogeneity

Under Model B1, the variance of the random effects of the logit model and the log-normal model were assumed to be homogeneous, such that variation in these random effects, conditional on the covariates of the respective models in Eqs. (4) and (5), was the same across individuals. Here the assumption of homogeneity of variance across individuals is relaxed by allowing each variance of these two random effects to be predicted by the between-subject covariates Femi, Agei and their interaction (between-subject variation in these random effects was not thought to vary according to the proportion of survey days that fell on a weekend, and so PropDayi was not included in these models). This allowed us to study whether these covariates could account for variation in the random effects after controlling for these covariates as predictors of the individual's logit or mean log time. The models for the random effect variances \( {\upvarphi}_a^2 \) and \( {\upvarphi}_b^2 \) now can vary according to subject-level covariates as follows:

$$ {\upvarphi}_a^2=\exp \left({\lambda}_0+{\lambda}_1{Fem}_{\mathrm{i}}+{\lambda}_2{Age}_{\mathrm{i}}+{\lambda}_3{Fem}_{\mathrm{i}}\ast {Age}_{\mathrm{i}}\right) $$
(7)
$$ {\upvarphi}_b^2=\exp \left({\upkappa}_0+{\upkappa}_1{Fem}_{\mathrm{i}}+{\upkappa}_2{Age}_{\mathrm{i}}+{\upkappa}_3{Fem}_{\mathrm{i}}\ast {Age}_{\mathrm{i}}\right) $$
(8)

where λ0 and κ0, when exponentiated, are the (geometric) variances of the respective random effects when the covariates are equal to zero. The effects λ1, λ2 and λ3, relating to Femi, Agei and their interaction, respectively, are predictors of the random intercept variance of the logistic model, and κ1, κ2 and κ3, relating to Femi, Agei and their interaction, respectively, are predictors of the random intercept variance of the log-normal model. Positive values of these covariates would correspond to a greater degree of between-subject variation in the random effect (after adjusting for the covariates in Eqs. (4) and (5)), and negative values would correspond to a lower degree of between-subject variation in the random effect (again, after adjusting for the covariates in Eqs. (4) and (5)). As the variances of the random effects are functions of covariates, the variance-covariance matrix of the random effects is interpreted as having elements that are adjusted for the effects of covariates. Reported in Table 2, a deviance test compares the fit between Models B1 and B2 (χ²(15) = 464, P < .0001), indicating an improvement in fit after allowing for heterogeneity of the within- and between-subject covariance structures. ML estimates of the fixed effects are provided in the second column of results in Table 3, and estimates of the parameters that defined the within- and between-subject covariance structures are given in the second column of results in Table 4. Again, we delay model interpretation until later.

Reduced model

The effects of the covariates in Model B2 were evaluated and a reduced model (henceforth called Model B3; the Appendix provides syntax for fitting Model B3) was formed to provide a data description using a model that was parsimonious relative to Model B2. The three-way interaction between Femi, Agei and Dayij, was evaluated first, followed by the two-way interactions and then the main effects; an effect was excluded from the model if it was not statistically significant at the .05 level. For the final model obtained, a deviance test compares the fit between Models B2 and B3 (χ²(13) = 11, P = .61), indicating no appreciable decrease in fit after excluding a select subset of covariates (see Table 2).

From Table 3, the estimated effects of the covariates for the mixed-effects logistic regression model are interpreted here, noting that the estimated effects are conditional on the random subject effects. The estimated log odds that an individual engaged in leisure activities, if the respondent was male, at the sample mean age of 47.4 years, whose proportion of survey days taking place on a weekend was equal to the mean proportion of 0.23, and whose random effect for the logit intercept was equal to zero, was \( {\hat{\alpha}}_0 \)=3.5 (SE = 0.15). The log odds tended to be higher if the survey day fell on a weekend (\( {\hat{\alpha}}_1 \)=0.67, SE = 0.12) and lower if the respondent was female (\( {\hat{\alpha}}_2 \) = −0.59, SE = 0.16). Older individuals were also more likely to engage (\( {\hat{\alpha}}_3 \)= 0.02, SE = 0.006). These effects were each adjusted for each other and for between-subject differences in the proportion of weekend days surveyed (\( {\hat{\alpha}}_8 \)= 1.6, SE = 0.98), as well as controlling for the random effect ai.

The estimated mean log time spent, conditional on any time being spent, for males at the sample mean age and at the sample mean proportion of survey days falling on a weekend was \( {\hat{\gamma}}_0 \) = 1.0 (SE = 0.03), which when exponentiated is about 2.7 (geometric) mean hours per day. Mean log time tended to be higher for weekends at the sample mean age of 47.4 years (\( {\hat{\gamma}}_1 \) = 0.36, SE = 0.02), with the effect of a weekend being attenuated according to an increase in a respondent’s age (\( {\hat{\gamma}}_5 \) = −0.006, SE = 0.001). For males, older age corresponded to higher mean log time (\( {\hat{\gamma}}_3 \) = 0.010, SE = 0.002), with the relative effect of age attenuated for females (\( {\hat{\gamma}}_6 \) = −0.005, SE = 0.002). Relative to males, females at the sample mean age of 47.4 years had a lower mean log time (\( {\hat{\gamma}}_2 \) = −0.19, SE = 0.034). Each of these effects was adjusted for the other effects, as well as for between-subject differences in the proportion of weekend days surveyed (\( {\hat{\gamma}}_8 \) = −0.32, SE = 0.22).

From Table 4, within-subject variance of daily log time about an individual’s mean log time across days was greater if the survey took place on a weekend versus a weekday (\( {\hat{\tau}}_1 \) = 0.19, SE = 0.05), greater if the respondent was female (\( {\hat{\tau}}_2 \) = 0.14, SE = 0.06), and reduced for older respondents (\( {\hat{\tau}}_3 \) = −0.007, SE = 0.002). Each of these effects was adjusted for the other effects, as well as for between-subject differences in the proportion of weekend days surveyed (\( {\hat{\tau}}_8 \)= −0.51, SE = 0.40).

Between-subject variation in the logit (conditional on covariates) did not differ appreciably between males and females or with regard to age, indicating comparable degrees of between-subject variation in the individual logits at each level of the two covariates. Between-subject variation in the log mean time (conditional on covariates) was lower for females relative to males (\( {\hat{\kappa}}_1 \)= −0.23, SE = 0.09), indicating greater homogeneity among females relative to males. Variation in the log mean time did not vary appreciably with regard to age.

Finally, the random effects, after adjusting for the effects of covariates, were moderately related to each other. In particular, a higher likelihood to engage in leisure activities was positively related to the daily mean log time (\( {\hat{\rho}}_{ab} \) = .37, 95% CI: [.32, .42]), but likelihood to engage and daily mean log time were both negatively related to the within-subject daily variation in time spent (\( {\hat{\rho}}_{wa} \) = −.51, 95% CI: [−.55, −.46]; \( {\hat{\rho}}_{wb} \) = −.54, 95% CI: [−.50, −.58], respectively), indicating that greater stability in time spent tended to correspond to a lower likelihood to engage and a lower daily mean log time across days. It is important to mention as a final note that a deviance test done to evaluate the need for the random effect in the within-subject variance model indicated that between-subject heterogeneity of the within-subject variance remained after adjusting for the effects of covariates (χ²(3) = 416, P < .0001).

Comparing the different models

The key difference between the typical application of a two-part mixed-effects model (here, Model B1) and an extended version (here, Model B2), is that the latter allows for heterogeneity of both the within- and between-subject covariance structures. Thus, greater insight can be gained about a behavior by allowing covariates to predict the different sources of variation. For the leisure time data, covariates were particularly informative about heterogeneity of variation in daily time about a person’s mean time, and heterogeneity of variance remained even after accounting for these covariates. With regard to heterogeneity of variance in the random effects at the subject level, between-subject variation in the mean log time (adjusting for covariates) was greater for males relative to females, suggesting that males differ from each other to a greater extent than females with regard to daily mean time.

Discussion

Two-part models are useful in addressing research questions that relate to the likelihood that individuals will engage in a behavior, and separate from this, the extent of engagement given that any time was spent. In this way, two-part models may be preferred over other methods that do not make this distinction in a measured response. This is particularly relevant for time use data if a segment of a population does not engage in the target behavior and it is important to understand not only whether people engage in the behavior, but if they do, to what extent. A two-part model can be extended to a two-part mixed-effects model given repeated-measures data. A two-part mixed-effects model addresses dependencies in repeated measures by including random effects in each of the two model parts. The model permits one to study of the trajectories of the likelihood that individuals will engage in a behavior over time and the trajectories of the extent of engagement when engaged.

In a typical application of a two-part mixed-effects model, homogeneity of the within-subject and the between-subject covariance structures is assumed. For the within-subject covariance structure, an assumption of homogeneity of variance for the continuous model part implies that the degree of variation in an individual’s observed responses about their fitted mean response across the repeated measures does not differ appreciably between individuals. For the between-subject covariance structure, an assumption of homogeneity of variance for both the binary and the continuous model parts implies that the degree of between-subject variation in the random effects (e.g., random intercepts) is constant at all levels of any between-subject covariates.

An important feature of two-part mixed-effects models is their flexibility in how these models can be formulated. As illustrated in this paper, the distributions of the binary and the continuous response can be assumed to follow a distribution of one’s choosing. Here, we considered a logistic distribution for the binary response, and a normal, log-normal and gamma distribution for the continuous response. Other distributions for either model part are possible. This paper serves to highlight a particularly interesting aspect of this modeling framework, namely that it is possible to model the within-subject variation in scores across repeated measures, either by including covariates to study how or why individuals may differ in their variation in responses over time, or by including a random effect to document that there is heterogeneity of variation. It is also possible to model variation in the random effects that may be attributable to covariates. As illustrated using the empirical example presented in this paper, there was a notable difference between males and females in the variance of the random intercept for the continuous model part, suggesting a greater degree of individual differences between males than between females in time spent engaged in leisure activities. Not only did the extension of the model to allow for heterogeneity of variance in both the within-subject and between-subject components improve model fit, but interesting aspects of time spent in leisure activities were also brought to light.

Open Practices Statement: The data set used in the example is available for download at https://www.icpsr.umich.edu/icpsrweb/. This study was not preregistered.