<!DOCTYPE article PUBLIC "-//NLM//DTD JATS (Z39.96) Journal Archiving and Interchange DTD v1.0 20120330//EN" "JATS-archivearticle1.dtd">
<article xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:mml="http://www.w3.org/1998/Math/MathML" article-type="research-article"><?properties manuscript?><front><journal-meta><journal-id journal-id-type="nlm-journal-id">101514848</journal-id><journal-id journal-id-type="pubmed-jr-id">36433</journal-id><journal-id journal-id-type="nlm-ta">Stata J</journal-id><journal-id journal-id-type="iso-abbrev">Stata J</journal-id><journal-title-group><journal-title>The Stata journal</journal-title></journal-title-group><issn pub-type="ppub">1536-867X</issn></journal-meta><article-meta><article-id pub-id-type="pmid">29755297</article-id><article-id pub-id-type="pmc">5947963</article-id><article-id pub-id-type="manuscript">NIHMS913429</article-id><article-categories><subj-group subj-group-type="heading"><subject>Article</subject></subj-group></article-categories><title-group><article-title>Estimating inverse-probability weights for longitudinal data with dropout or truncation: The xtrccipw command</article-title></title-group><contrib-group><contrib contrib-type="author" corresp="yes"><name><surname>Daza</surname><given-names>Eric J.</given-names></name><!--<email>ericjdaza@stanford.edu</email>--><aff id="A1">Stanford Prevention Research Center, Stanford University, Stanford, CA</aff></contrib><contrib contrib-type="author"><name><surname>Hudgens</surname><given-names>Michael G.</given-names></name><aff id="A2">Department of Biostatistics, University of North Carolina at Chapel Hill, Chapel Hill, NC</aff></contrib><contrib contrib-type="author"><name><surname>Herring</surname><given-names>Amy H.</given-names></name><aff id="A3">Department of Biostatistics and Carolina Population Center, University of North Carolina at Chapel Hill, Chapel Hill, NC</aff></contrib></contrib-group><pub-date pub-type="nihms-submitted"><day>17</day><month>10</month><year>2017</year></pub-date><pub-date pub-type="ppub"><season>2nd Quarter</season><year>2017</year></pub-date><pub-date pub-type="pmc-release"><day>11</day><month>5</month><year>2018</year></pub-date><volume>17</volume><issue>2</issue><fpage>253</fpage><lpage>278</lpage><abstract><p id="P1">Individuals may drop out of a longitudinal study, rendering their outcomes unobserved but still well defined. However, they may also undergo truncation (for example, death), beyond which their outcomes are no longer meaningful. <xref rid="R12" ref-type="bibr">Kurland and Heagerty (2005</xref>, <italic>Biostatistics</italic> 6: 241&#x02013;258) developed a method to conduct regression conditioning on nontruncation, that is, regression conditioning on continuation (RCC), for longitudinal outcomes that are monotonically missing at random (for example, because of dropout). This method first estimates the probability of dropout among continuing individuals to construct inverse-probability weights (IPWs), then fits generalized estimating equations (GEE) with these IPWs. In this article, we present the 
<monospace>xtrccipw</monospace> command, which can both estimate the IPWs required by RCC and then use these IPWs in a GEE estimator by calling the 
<monospace>glm</monospace> command from within 
<monospace>xtrccipw</monospace>. In the absence of truncation, the 
<monospace>xtrccipw</monospace> command can also be used to run a weighted GEE analysis. We demonstrate the 
<monospace>xtrccipw</monospace> command by analyzing an example dataset and the original <xref rid="R12" ref-type="bibr">Kurland and Heagerty (2005)</xref> data. We also use 
<monospace>xtrccipw</monospace> to illustrate some empirical properties of RCC through a simulation study.</p></abstract><kwd-group><kwd>st0474</kwd><kwd>xtrccipw</kwd><kwd>dropout</kwd><kwd>generalized estimating equations</kwd><kwd>inverse-probability weights</kwd><kwd>longitudinal data</kwd><kwd>missing at random</kwd><kwd>truncation</kwd><kwd>weighted GEE</kwd></kwd-group></article-meta></front><body><sec id="S1"><title>1 Introduction</title><p id="P2">Consider an individual&#x02019;s outcomes over time, which form an outcome trajectory. Events such as death can truncate the trajectory, rendering the outcome at and after truncation undefined. Death is a common truncating event in biomedical studies (<xref rid="R17" ref-type="bibr">Ribaudo, Thompson, and Allen-Mersh 2000</xref>; <xref rid="R2" ref-type="bibr">Billingham and Abrams 2002</xref>; <xref rid="R16" ref-type="bibr">Pauler, McCoy, and Moinpour 2003</xref>; <xref rid="R5" ref-type="bibr">Dufouil, Brayne, and Clayton 2004</xref>; <xref rid="R23" ref-type="bibr">Shardell and Miller 2008</xref>; <xref rid="R1" ref-type="bibr">Basu and Manning 2010</xref>). For example, the Precipitating Events Project (PEP) is an ongoing longitudinal study of 754 community-living individuals aged 70 or older who are scheduled to be followed monthly for 2 years (<xref rid="R8" ref-type="bibr">Gill et al. 2001</xref>; <xref rid="R7" ref-type="bibr">Gill 2014</xref>). <xref rid="R12" ref-type="bibr">Kurland and Heagerty (2005)</xref> considered inference about the probability of activities-of-daily-living (ADL) disability conditioning on being alive, treating death as a truncating event in the PEP data. Other events, such as disease relapse and HIV infection, have also been defined as truncating events. For instance, investigators of the Breastfeeding, Antiretrovirals, and Nutrition study (<xref rid="R11" ref-type="bibr">van der Horst et al. 2009</xref>) wanted to draw inference about a target population of infants at high risk of HIV infection but only while they were alive and uninfected (<xref rid="R6" ref-type="bibr">Flax et al. 2012</xref>). In this case, HIV infection and death are truncating events. In <xref rid="R3" ref-type="bibr">le Cessie et al. (2009)</xref>, the target population consisted of patients with advanced breast cancer who had undergone chemotherapy. The authors wanted to draw inference about patients who were alive and disease free, such that death and relapse were truncating events.</p><p id="P3">For all the aforementioned examples of truncated longitudinal data, outcomes were also missing for some individuals. Dropout events occur when an individual leaves the study permanently. For study dropout, the corresponding outcomes are unobserved, but unlike truncation, they are well defined. Three comprehensive types of such missingness were characterized by <xref rid="R21" ref-type="bibr">Rubin (1976)</xref> and <xref rid="R15" ref-type="bibr">Little and Rubin (2002)</xref>. In their framework, outcomes are defined to be missing completely at random (MCAR) if missingness is independent of any outcomes. If the pattern of missingness is independent of all missing outcomes conditional only on observed outcomes, then the outcomes are missing at random (MAR). Finally, if missingness is not MAR or MCAR, the outcomes are said to be not missing at random, or missing not at random (MNAR). The method of generalized estimating equations (GEE), which is frequently used to estimate the marginal means of a longitudinal outcome, can accommodate missingness. If outcomes are MCAR, then the GEE estimator is consistent for these marginal means (<xref rid="R14" ref-type="bibr">Liang and Zeger 1986</xref>; <xref rid="R4" ref-type="bibr">Diggle et al. 2002</xref>). If outcomes are either MAR or MNAR, inverse-probability weights (IPWs) may be used to ensure consistency of the GEE estimator provided that the data missingness model is correctly specified (<xref rid="R20" ref-type="bibr">Robins, Rotnitzky, and Zhao 1995</xref>; <xref rid="R22" ref-type="bibr">Scharfstein, Rotnitzky, and Robins 1999</xref>). We refer to this approach as the weighted GEE (WEE) method.</p><p id="P4">Typical approaches to analyzing longitudinal outcomes with missing data include both WEE and maximum likelihood methods such as mixed-effects models. These approaches generally do not distinguish truncation from dropout, in essence envisaging outcomes past the point of truncation. <xref rid="R12" ref-type="bibr">Kurland and Heagerty (2005)</xref> described such approaches that implicitly assume the existence of outcomes after truncation as unconditional regression (UR) models, because they estimate the mean outcome averaged over individuals who have and have not been truncated. <xref rid="R13" ref-type="bibr">Kurland et al. (2009)</xref> consider both standard selection models and conditional submodels of pattern-mixture models to be UR models. Mean outcomes among continuing trajectories may be estimated indirectly with these two types of UR models, with additional modeling assumptions (<xref rid="R13" ref-type="bibr">Kurland et al. 2009</xref>). As an alternative to UR models, one can use joint modeling of longitudinal measurements and time to truncation (<xref rid="R10" ref-type="bibr">Henderson, Diggle, and Dobson 2000</xref>; <xref rid="R9" ref-type="bibr">Guo and Carlin 2004</xref>; <xref rid="R13" ref-type="bibr">Kurland et al. 2009</xref>).</p><p id="P5">To estimate mean outcomes directly without joint modeling, <xref rid="R12" ref-type="bibr">Kurland and Heagerty (2005)</xref> developed a method for regression conditioning on continuation (RCC), that is, not being truncated. The RCC method consistently estimates continuing longitudinal mean outcomes by first modeling and estimating IPWs at each time point based on the probability of dropout, but only for subjects with a continuing outcome at that time point. RCC then applies these IPWs in a WEE framework. In the absence of truncation, the usual WEE method is therefore a special case of RCC. When there is truncation, WEE is a UR approach that will generally not produce consistent estimates for RCC estimands (<xref rid="R12" ref-type="bibr">Kurland and Heagerty 2005</xref>). Unfortunately, there is currently no widely available Stata command for estimating the IPWs used in either RCC or WEE. The 
<monospace>teffects</monospace> commands 
<monospace>aipw</monospace> (see [TE] <bold>teffects aipw</bold>), 
<monospace>ipw</monospace> (see [TE] <bold>teffects ipw</bold>), and 
<monospace>ipwra</monospace> (see [TE] <bold>teffects ipwra</bold>) estimate IPWs with the goal of making causal inferences by estimating average treatment effects. The 
<monospace>stteffects ipwra</monospace> command (see [TE] <bold>stteffects ipwra</bold>) estimates IPWs that adjust for outcomes that are missing because of censoring and uses these IPWs in survival analysis of time-to-event outcomes. In this article, we introduce the 
<monospace>xtrccipw</monospace> command to allow Stata users to estimate the IPWs used by RCC in analyzing longitudinal outcomes subject to dropout or truncation. These IPWs can then be used as 
<monospace>pweight</monospace> values in the 
<monospace>glm</monospace> command with the 
<monospace>vce</monospace>(
<monospace>cluster</monospace>
<italic>clustvar</italic>) option to perform WEE estimation, which can be executed within a call to 
<monospace>xtrccipw</monospace> if requested. When there is no truncation, 
<monospace>xtrccipw</monospace> can also be used to estimate the IPWs used in a WEE analysis. When there is truncation but no dropout, the 
<monospace>xtrccipw</monospace> command produces IPWs that all equal 1, resulting in unweighted GEE regression.</p><p id="P6">The remainder of this article is organized as follows: In section 2, we introduce some notation and the assumptions behind the RCC method, detail the modeling of the dropout mechanism, and note some asymptotic properties of the RCC estimator. In section 3, we explain the 
<monospace>xtrccipw</monospace> command. In section 4, we conduct RCC on a binary outcome using an example dataset. In section 5, we perform a simulation study based on the original <xref rid="R12" ref-type="bibr">Kurland and Heagerty (2005)</xref> simulations and reanalyze their empirical data. In section 6, we conclude the article.</p></sec><sec id="S2"><title>2 Background and methods</title><sec id="S3"><title>2.1 Notation and assumptions</title><p id="P7">Consider a random sample of <italic>i</italic> = 1, &#x02026;, <italic>n</italic> individuals, each of whom is scheduled to be measured at fixed study time points <italic>j</italic> = 1, &#x02026;, <italic>m</italic>. Where it is not ambiguous, the dependence on <italic>i</italic> will be suppressed for notational ease. To illustrate the relevant concepts, we use an example wherein the outcome is individual alanine transaminase (ALT) measured in international units/liter (IU/L) measured at up to <italic>m</italic> = 3 study visits, and individuals may die or drop out of the study. The example data are listed in <xref ref-type="table" rid="T1">table 1</xref>, where 
<monospace>idvar</monospace> is the variable that denotes individual identifier, 
<monospace>timevar</monospace> denotes study visit date, 
<monospace>timeidxvar</monospace> denotes study visit number, 
<monospace>outcomevar</monospace> denotes ALT, 
<monospace>tdindepvar</monospace> denotes a time-dependent continuous-valued covariate, and 
<monospace>tiindepvar</monospace> denotes a time-independent binary-valued covariate (for example, a baseline variable).</p><p id="P8">We first introduce notation for the outcomes and truncation. Let <italic>Y<sub>j</sub></italic> denote the primary outcome of interest, for example, ALT, at time point <italic>j</italic>. Let <italic>C<sub>j</sub></italic> = 1 if the truncating event, for example, death, has not occurred by <italic>j</italic>, and let <italic>C<sub>j</sub></italic> = 0 otherwise. Thus the outcome <italic>Y<sub>j</sub></italic> is well defined only if <italic>C<sub>j</sub></italic> = 1. In general, we define truncation as an irreversible state transition such that <italic>C<sub>j</sub></italic> = 0 implies <italic>C</italic><sub><italic>j</italic>&#x02032;</sub> = 0 for all <italic>j</italic>&#x02032; &#x0003e; <italic>j</italic>. Define 
<inline-formula><mml:math id="M1" overflow="scroll"><mml:mi>S</mml:mi><mml:mo>=</mml:mo><mml:msubsup><mml:mo>&#x02211;</mml:mo><mml:mrow><mml:mi>j</mml:mi><mml:mo>=</mml:mo><mml:mn>1</mml:mn></mml:mrow><mml:mi>m</mml:mi></mml:msubsup><mml:msub><mml:mi>C</mml:mi><mml:mi>j</mml:mi></mml:msub></mml:math></inline-formula> to be the number of time points before a trajectory is truncated, with <italic>S</italic> = <italic>m</italic> indicating that the trajectory is not truncated. If truncation occurs at <italic>j</italic>, then outcomes at <italic>j</italic> and beyond (that is, <italic>Y<sub>j</sub></italic>, &#x02026;, <italic>Y<sub>m</sub></italic>) are undefined. We use &#x0201c;*&#x0201d; to denote all undefined values, which extends the support of the outcome <italic>Y</italic>. In <xref ref-type="table" rid="T1">table 1</xref>, where 
<monospace>trtimevar</monospace> denotes truncation time, individual 4 died between study visits 2 and 3.</p><p id="P9">The indicator variable for dropout is defined as follows. If truncation has not occurred by time point <italic>j</italic>, but if that individual dropped out of the study at or before <italic>j</italic>, then his or her outcome is still defined at <italic>j</italic> but is not observed. If <italic>C<sub>j</sub></italic> = 1, let <italic>R<sub>j</sub></italic> = 1 if an individual has not dropped out by <italic>j</italic>; otherwise, let <italic>R<sub>j</sub></italic> = 0. Assume that there is no dropout at <italic>j</italic> = 1 (that is, <italic>R</italic><sub>1</sub> = 1) and that dropout is monotonic such that <italic>R<sub>j</sub></italic> = 0 implies <italic>R</italic><sub><italic>j</italic>&#x02032;</sub> = 0 for all <italic>j</italic>&#x02032; &#x0003e; <italic>j</italic>. If <italic>C<sub>j</sub></italic> = 0, then we adopt the convention that <italic>R<sub>j</sub></italic> = *. In <xref ref-type="table" rid="T1">table 1</xref>, individual 2 never died during the study but dropped out by visit 3; missing values are denoted using &#x0201c;.&#x0201d;. Individual 4, however, dropped out of the study between visits 1 and 2 and died between the scheduled times for visits 2 and 3.</p><p id="P10">The assumptions about the dropout mechanism are now defined. For any time-varying random variable <italic>A</italic>, let <italic>&#x00100;<sub>j</sub></italic> = (<italic>A</italic><sub>1</sub>, &#x02026;, <italic>A<sub>j</sub></italic>) so that <italic>&#x00100;</italic><sub><italic>j</italic>&#x02212;1</sub> represents an individual&#x02019;s history of <italic>A</italic> prior to <italic>j</italic>. In <xref ref-type="table" rid="T1">table 1</xref>, the full truncation vector of individual 1 is <italic>&#x00043;&#x00305;</italic><sub>3</sub> = (1, 1, 1), while his or her ALT history prior to study visit 3 is <italic>&#x00232;</italic><sub>2</sub> = (<italic>Y</italic><sub>1</sub>, <italic>Y</italic><sub>2</sub>) = (13, 14). Let 
<inline-formula><mml:math id="M2" overflow="scroll"><mml:msubsup><mml:mover><mml:mi>Y</mml:mi><mml:mo>&#x000af;</mml:mo></mml:mover><mml:mi>j</mml:mi><mml:mtext>obs</mml:mtext></mml:msubsup></mml:math></inline-formula> denote the vector of observed values of <italic>&#x00232;<sub>j</sub></italic>, that is, (<italic>Y<sub>k</sub></italic>: <italic>R<sub>k</sub></italic> = 1, <italic>k</italic> &#x02264; <italic>j</italic>). In <xref ref-type="table" rid="T1">table 1</xref>, 
<inline-formula><mml:math id="M3" overflow="scroll"><mml:msubsup><mml:mover><mml:mi>Y</mml:mi><mml:mo>&#x000af;</mml:mo></mml:mover><mml:mn>1</mml:mn><mml:mtext>obs</mml:mtext></mml:msubsup><mml:mo>=</mml:mo><mml:mo stretchy="false">(</mml:mo><mml:msub><mml:mi>Y</mml:mi><mml:mn>1</mml:mn></mml:msub><mml:mo stretchy="false">)</mml:mo><mml:mo>=</mml:mo><mml:mo stretchy="false">(</mml:mo><mml:mn>25</mml:mn><mml:mo stretchy="false">)</mml:mo></mml:math></inline-formula> and 
<inline-formula><mml:math id="M4" overflow="scroll"><mml:msubsup><mml:mover><mml:mi>Y</mml:mi><mml:mo>&#x000af;</mml:mo></mml:mover><mml:mn>2</mml:mn><mml:mtext>obs</mml:mtext></mml:msubsup><mml:mo>=</mml:mo><mml:msubsup><mml:mover><mml:mi>Y</mml:mi><mml:mo>&#x000af;</mml:mo></mml:mover><mml:mn>3</mml:mn><mml:mtext>obs</mml:mtext></mml:msubsup><mml:mo>=</mml:mo><mml:mo stretchy="false">(</mml:mo><mml:msub><mml:mi>Y</mml:mi><mml:mn>1</mml:mn></mml:msub><mml:mo>,</mml:mo><mml:msub><mml:mi>Y</mml:mi><mml:mn>2</mml:mn></mml:msub><mml:mo stretchy="false">)</mml:mo><mml:mo>=</mml:mo><mml:mo stretchy="false">(</mml:mo><mml:mn>25</mml:mn><mml:mo>,</mml:mo><mml:mn>23</mml:mn><mml:mo stretchy="false">)</mml:mo></mml:math></inline-formula> for individual 3, while 
<inline-formula><mml:math id="M5" overflow="scroll"><mml:msubsup><mml:mover><mml:mi>Y</mml:mi><mml:mo>&#x000af;</mml:mo></mml:mover><mml:mn>1</mml:mn><mml:mtext>obs</mml:mtext></mml:msubsup><mml:mo>=</mml:mo><mml:msubsup><mml:mover><mml:mi>Y</mml:mi><mml:mo>&#x000af;</mml:mo></mml:mover><mml:mn>2</mml:mn><mml:mtext>obs</mml:mtext></mml:msubsup><mml:mo>=</mml:mo><mml:msubsup><mml:mover><mml:mi>Y</mml:mi><mml:mo>&#x000af;</mml:mo></mml:mover><mml:mn>3</mml:mn><mml:mtext>obs</mml:mtext></mml:msubsup><mml:mo>=</mml:mo><mml:mo stretchy="false">(</mml:mo><mml:msub><mml:mi>Y</mml:mi><mml:mn>1</mml:mn></mml:msub><mml:mo stretchy="false">)</mml:mo><mml:mo>=</mml:mo><mml:mo stretchy="false">(</mml:mo><mml:mn>15</mml:mn><mml:mo stretchy="false">)</mml:mo></mml:math></inline-formula> for individual 4. Let <italic>&#x003c0;<sub>j</sub></italic> denote the probability of not dropping out conditional on all outcomes and the full truncation vector, that is, <italic>&#x003c0;<sub>j</sub></italic> = Pr (<italic>R<sub>j</sub></italic> = 1|<italic>&#x00232;<sub>m</sub>,&#x00043;&#x00305;<sub>m</sub></italic>), and assume <italic>&#x003c0;</italic><sub>1</sub> = Pr (<italic>R</italic><sub>1</sub> = 1|<italic>C</italic><sub>1</sub>). We refer to outcomes as MAR if 
<inline-formula><mml:math id="M6" overflow="scroll"><mml:msub><mml:mi>&#x003c0;</mml:mi><mml:mi>j</mml:mi></mml:msub><mml:mo>=</mml:mo><mml:mtext>Pr&#x000a0;</mml:mtext><mml:mo stretchy="false">(</mml:mo><mml:msub><mml:mi>R</mml:mi><mml:mi>j</mml:mi></mml:msub><mml:mo>=</mml:mo><mml:mn>1</mml:mn><mml:mo stretchy="false">|</mml:mo><mml:msubsup><mml:mover><mml:mi>Y</mml:mi><mml:mo>&#x000af;</mml:mo></mml:mover><mml:mrow><mml:mi>j</mml:mi><mml:mo>&#x02212;</mml:mo><mml:mn>1</mml:mn></mml:mrow><mml:mtext>obs</mml:mtext></mml:msubsup><mml:mo>,</mml:mo><mml:msub><mml:mover><mml:mi>C</mml:mi><mml:mo>&#x000af;</mml:mo></mml:mover><mml:mi>j</mml:mi></mml:msub><mml:mo stretchy="false">)</mml:mo></mml:math></inline-formula> for all <italic>j</italic> &#x0003e; 1. We refer to outcomes as MCAR if <italic>&#x003c0;<sub>j</sub></italic> = Pr (<italic>R<sub>j</sub></italic> = 1|<italic>&#x00043;&#x00305;<sub>j</sub></italic>) for all <italic>j</italic> &#x0003e; 1. Outcomes that are neither MAR nor MCAR are MNAR. Under MAR, 
<inline-formula><mml:math id="M7" overflow="scroll"><mml:msub><mml:mi>&#x003c0;</mml:mi><mml:mi>j</mml:mi></mml:msub><mml:mo>=</mml:mo><mml:msubsup><mml:mo>&#x0220f;</mml:mo><mml:mrow><mml:mi>k</mml:mi><mml:mo>=</mml:mo><mml:mn>1</mml:mn></mml:mrow><mml:mi>j</mml:mi></mml:msubsup><mml:msub><mml:mi>&#x003bb;</mml:mi><mml:mi>k</mml:mi></mml:msub></mml:math></inline-formula>, where 
<inline-formula><mml:math id="M8" overflow="scroll"><mml:msub><mml:mi>&#x003bb;</mml:mi><mml:mi>k</mml:mi></mml:msub><mml:mo>=</mml:mo><mml:mtext>Pr&#x000a0;</mml:mtext><mml:mo stretchy="false">(</mml:mo><mml:msub><mml:mi>R</mml:mi><mml:mi>k</mml:mi></mml:msub><mml:mo>=</mml:mo><mml:mn>1</mml:mn><mml:mo stretchy="false">|</mml:mo><mml:msub><mml:mi>R</mml:mi><mml:mrow><mml:mi>k</mml:mi><mml:mo>&#x02212;</mml:mo><mml:mn>1</mml:mn></mml:mrow></mml:msub><mml:mo>=</mml:mo><mml:mn>1</mml:mn><mml:mo>,</mml:mo><mml:msubsup><mml:mover><mml:mi>Y</mml:mi><mml:mo>&#x000af;</mml:mo></mml:mover><mml:mrow><mml:mi>k</mml:mi><mml:mo>&#x02212;</mml:mo><mml:mn>1</mml:mn></mml:mrow><mml:mtext>obs</mml:mtext></mml:msubsup><mml:mo>,</mml:mo><mml:msub><mml:mover><mml:mi>C</mml:mi><mml:mo>&#x000af;</mml:mo></mml:mover><mml:mi>k</mml:mi></mml:msub><mml:mo stretchy="false">)</mml:mo></mml:math></inline-formula> for <italic>k</italic> &#x0003e; 1 and <italic>&#x003bb;</italic><sub>1</sub> = <italic>&#x003c0;</italic><sub>1</sub>. The 
<monospace>xtrccipw</monospace> command lets the user specify a model for <italic>&#x003bb;<sub>k</sub></italic>.</p></sec><sec id="S4"><title>2.2 The full and reduced dropout models</title><p id="P11">In the presence of dropout, the RCC method requires specification of a dropout model. The 
<monospace>xtrccipw</monospace> command allows the user to choose between two parametric models. In particular, let <italic>g</italic>(&#x000b7;) represent the logit or probit link function. The default dropout-mechanism model specified by 
<monospace>xtrccipw</monospace> is
<disp-formula id="FD1"><label>(1)</label><mml:math id="M9" display="block" overflow="scroll"><mml:mi>g</mml:mi><mml:mo stretchy="false">(</mml:mo><mml:msub><mml:mi>&#x003bb;</mml:mi><mml:mtext mathvariant="italic">ik</mml:mtext></mml:msub><mml:mo stretchy="false">)</mml:mo><mml:mo>=</mml:mo><mml:msub><mml:mi>&#x003b1;</mml:mi><mml:mrow><mml:mn>0</mml:mn><mml:mi>k</mml:mi></mml:mrow></mml:msub><mml:mo>+</mml:mo><mml:msubsup><mml:mi mathvariant="bold">z</mml:mi><mml:mtext mathvariant="italic">ik</mml:mtext><mml:mo>&#x02032;</mml:mo></mml:msubsup><mml:msub><mml:mi mathvariant="bold-italic">&#x003b1;</mml:mi><mml:mrow><mml:mn>1</mml:mn><mml:mi>k</mml:mi></mml:mrow></mml:msub><mml:mo>+</mml:mo><mml:mi>I</mml:mi><mml:mo stretchy="false">(</mml:mo><mml:mi>k</mml:mi><mml:mo>&#x0003e;</mml:mo><mml:mn>1</mml:mn><mml:mo stretchy="false">)</mml:mo><mml:msubsup><mml:mover><mml:mi>Y</mml:mi><mml:mo>&#x000af;</mml:mo></mml:mover><mml:mrow><mml:mi>i</mml:mi><mml:mo stretchy="false">(</mml:mo><mml:mi>k</mml:mi><mml:mo>&#x02212;</mml:mo><mml:mn>1</mml:mn><mml:mo stretchy="false">)</mml:mo></mml:mrow><mml:mrow><mml:mtext>obs</mml:mtext><mml:mo>&#x02032;</mml:mo></mml:mrow></mml:msubsup><mml:msub><mml:mi mathvariant="bold-italic">&#x003b1;</mml:mi><mml:mrow><mml:mn>2</mml:mn><mml:mi>k</mml:mi></mml:mrow></mml:msub></mml:math></disp-formula>where <italic>&#x003b1;</italic><sub>0<italic>k</italic></sub> is the intercept, <bold>z</bold><sub><italic>ik</italic></sub> represents the vector of time-dependent and time-independent covariates with conformable parameter vector <bold><italic>&#x003b1;</italic></bold><sub>1<italic>k</italic></sub>, <italic>I</italic>(<italic>a</italic>) = 1 if <italic>a</italic> is true and <italic>I</italic>(<italic>a</italic>) = 0 otherwise, and <bold><italic>&#x003b1;</italic></bold><sub>2<italic>k</italic></sub> represents the conformable parameter vector corresponding to lagged outcome values 
<inline-formula><mml:math id="M10" overflow="scroll"><mml:msubsup><mml:mover><mml:mi>Y</mml:mi><mml:mo>&#x000af;</mml:mo></mml:mover><mml:mrow><mml:mi>i</mml:mi><mml:mo stretchy="false">(</mml:mo><mml:mi>k</mml:mi><mml:mo>&#x02212;</mml:mo><mml:mn>1</mml:mn><mml:mo stretchy="false">)</mml:mo></mml:mrow><mml:mtext>obs</mml:mtext></mml:msubsup></mml:math></inline-formula>. <xref ref-type="disp-formula" rid="FD1">Equation (1)</xref> is referred to as the full dropout model. Note that <italic>&#x003b1;</italic><sub>0<italic>k</italic></sub>, <bold><italic>&#x003b1;</italic></bold><sub>1<italic>k</italic></sub>, and <bold><italic>&#x003b1;</italic></bold><sub>2<italic>k</italic></sub> depend on time (as indexed by <italic>k</italic>); that is, the dropout model is estimated at each time point by default. If dropout is assumed or known to be completely at random, but truncation is present, the user has the option to specify an MCAR model instead, which sets <bold><italic>&#x003b1;</italic></bold><sub>2<italic>k</italic></sub> = <bold>0</bold>.</p><p id="P12">The user may want to estimate a reduced model with fewer lags, with possible values lag = 1, &#x02026;, <italic>m</italic> &#x02212; 1. In this case, the dropout mechanism is instead modeled as
<disp-formula id="FD2"><label>(2)</label><mml:math id="M11" display="block" overflow="scroll"><mml:mi>g</mml:mi><mml:mo stretchy="false">(</mml:mo><mml:msub><mml:mi>&#x003bb;</mml:mi><mml:mtext mathvariant="italic">ik</mml:mtext></mml:msub><mml:mo stretchy="false">)</mml:mo><mml:mo>=</mml:mo><mml:mo stretchy="true">{</mml:mo><mml:mtable><mml:mtr><mml:mtd columnalign="left"><mml:msub><mml:mi>&#x003b1;</mml:mi><mml:mrow><mml:mn>0</mml:mn><mml:mi>k</mml:mi></mml:mrow></mml:msub><mml:mo>+</mml:mo><mml:msubsup><mml:mi mathvariant="bold">z</mml:mi><mml:mtext mathvariant="italic">ik</mml:mtext><mml:mo>&#x02032;</mml:mo></mml:msubsup><mml:msub><mml:mi mathvariant="bold-italic">&#x003b1;</mml:mi><mml:mrow><mml:mn>1</mml:mn><mml:mi>k</mml:mi></mml:mrow></mml:msub><mml:mo>+</mml:mo><mml:msubsup><mml:mi>L</mml:mi><mml:mtext mathvariant="italic">ik</mml:mtext><mml:mo>&#x02032;</mml:mo></mml:msubsup><mml:msub><mml:mi mathvariant="bold-italic">&#x003b1;</mml:mi><mml:mrow><mml:mn>2</mml:mn><mml:mi>k</mml:mi></mml:mrow></mml:msub></mml:mtd><mml:mtd columnalign="left"><mml:mtext>if&#x000a0;</mml:mtext><mml:mi>k</mml:mi><mml:mo>&#x02264;</mml:mo><mml:mtext>&#x000a0;lag</mml:mtext></mml:mtd></mml:mtr><mml:mtr><mml:mtd columnalign="left"><mml:msub><mml:mi>&#x003b1;</mml:mi><mml:mn>0</mml:mn></mml:msub><mml:mo>+</mml:mo><mml:msubsup><mml:mi mathvariant="bold">z</mml:mi><mml:mtext mathvariant="italic">ik</mml:mtext><mml:mo>&#x02032;</mml:mo></mml:msubsup><mml:msub><mml:mi mathvariant="bold-italic">&#x003b1;</mml:mi><mml:mn>1</mml:mn></mml:msub><mml:mo>+</mml:mo><mml:msubsup><mml:mi>L</mml:mi><mml:mtext mathvariant="italic">ik</mml:mtext><mml:mo>&#x02032;</mml:mo></mml:msubsup><mml:msub><mml:mi mathvariant="bold-italic">&#x003b1;</mml:mi><mml:mn>2</mml:mn></mml:msub></mml:mtd><mml:mtd columnalign="left"><mml:mtext>if&#x000a0;</mml:mtext><mml:mi>k</mml:mi><mml:mo>&#x0003e;</mml:mo><mml:mtext>&#x000a0;lag</mml:mtext></mml:mtd></mml:mtr></mml:mtable></mml:math></disp-formula>where <italic>L<sub>ik</sub></italic> = (0) at <italic>k</italic> = 1 and <italic>L<sub>ik</sub></italic> = (<italic>Y</italic><sub><italic>i</italic>{max(1,<italic>k</italic>&#x02212;lag)}</sub>, &#x02026;, <italic>Y</italic><sub><italic>i</italic> (<italic>k</italic>&#x02212;1)</sub>) at <italic>k</italic> &#x0003e; 1. <xref ref-type="disp-formula" rid="FD2">Equation (2)</xref> is referred to as the reduced dropout model. This model is time dependent for time points <italic>k</italic> &#x02264; lag but shares the same parameters for time points <italic>k</italic> &#x0003e; lag. This approach allows 
<monospace>xtrccipw</monospace> to estimate fewer parameters by assuming a common dropout model once all the requested lagged outcomes potentially become available for estimation (that is, for time points <italic>k</italic> &#x0003e; lag). The user has the option to specify a reduced MCAR model instead, which estimates the model 
<inline-formula><mml:math id="M12" overflow="scroll"><mml:mi>g</mml:mi><mml:mo stretchy="false">(</mml:mo><mml:msub><mml:mi>&#x003bb;</mml:mi><mml:mtext mathvariant="italic">ik</mml:mtext></mml:msub><mml:mo stretchy="false">)</mml:mo><mml:mo>=</mml:mo><mml:msub><mml:mi>&#x003b1;</mml:mi><mml:mn>0</mml:mn></mml:msub><mml:mo>+</mml:mo><mml:msubsup><mml:mi mathvariant="bold">z</mml:mi><mml:mtext mathvariant="italic">ik</mml:mtext><mml:mo>&#x02032;</mml:mo></mml:msubsup><mml:msub><mml:mi mathvariant="bold-italic">&#x003b1;</mml:mi><mml:mn>1</mml:mn></mml:msub></mml:math></inline-formula>.</p><p id="P13">Note that the full and reduced MAR models are identical when lag = <italic>m</italic> &#x02212; 1 is set, while the full and reduced MCAR models are different. The full MCAR model specifies a model at each time point, while the reduced MCAR model specifies a common model across all time points.</p></sec><sec id="S5"><title>2.3 Inference</title><p id="P14">This section briefly describes inference about longitudinal mean outcome models for continuing individuals, conditional on covariates. Let 
<inline-formula><mml:math id="M13" overflow="scroll"><mml:msubsup><mml:mi>&#x003bc;</mml:mi><mml:mtext mathvariant="italic">ij</mml:mtext><mml:mtext>RCC</mml:mtext></mml:msubsup><mml:mo>=</mml:mo><mml:mi>E</mml:mi><mml:mo stretchy="false">(</mml:mo><mml:msub><mml:mi>Y</mml:mi><mml:mtext mathvariant="italic">ij</mml:mtext></mml:msub><mml:mo stretchy="false">|</mml:mo><mml:msub><mml:mi>C</mml:mi><mml:mtext mathvariant="italic">ij</mml:mtext></mml:msub><mml:mo>=</mml:mo><mml:mn>1</mml:mn><mml:mo stretchy="false">)</mml:mo></mml:math></inline-formula> denote the mean outcome for individual <italic>i</italic> whose trajectory is still continuing at time point <italic>j</italic>. In the regression setting, we might posit a generalized linear model of the form 
<inline-formula><mml:math id="M14" overflow="scroll"><mml:mi>h</mml:mi><mml:mo stretchy="false">(</mml:mo><mml:msubsup><mml:mi>&#x003bc;</mml:mi><mml:mtext mathvariant="italic">ij</mml:mtext><mml:mtext>RCC</mml:mtext></mml:msubsup><mml:mo stretchy="false">)</mml:mo><mml:mo>=</mml:mo><mml:msubsup><mml:mi mathvariant="bold">x</mml:mi><mml:mtext mathvariant="italic">ij</mml:mtext><mml:mo>&#x02032;</mml:mo></mml:msubsup><mml:msup><mml:mi mathvariant="bold-italic">&#x003b2;</mml:mi><mml:mtext>RCC</mml:mtext></mml:msup></mml:math></inline-formula>, where <italic>h</italic>(&#x000b7;) is a link function, <bold>x</bold><sub><italic>ij</italic></sub> is an observed <italic>p</italic> &#x000d7; 1 vector of possibly time-dependent covariates that includes a column of ones for the intercept, and <bold><italic>&#x003b2;</italic></bold><sup>RCC</sup> is the corresponding parameter vector. We refer to this as the outcome model. Let 
<inline-formula><mml:math id="M15" overflow="scroll"><mml:msubsup><mml:mi mathvariant="bold">d</mml:mi><mml:mtext mathvariant="italic">ij</mml:mtext><mml:mo>&#x02032;</mml:mo></mml:msubsup><mml:mo>=</mml:mo><mml:mo>&#x02202;</mml:mo><mml:msubsup><mml:mi>&#x003bc;</mml:mi><mml:mtext mathvariant="italic">ij</mml:mtext><mml:mtext>RCC</mml:mtext></mml:msubsup><mml:mo>/</mml:mo><mml:mo>&#x02202;</mml:mo><mml:msup><mml:mi mathvariant="bold-italic">&#x003b2;</mml:mi><mml:mtext>RCC</mml:mtext></mml:msup></mml:math></inline-formula> denote the Jacobian of partial derivatives of 
<inline-formula><mml:math id="M16" overflow="scroll"><mml:msubsup><mml:mi>&#x003bc;</mml:mi><mml:mtext mathvariant="italic">ij</mml:mtext><mml:mtext>RCC</mml:mtext></mml:msubsup></mml:math></inline-formula> with respect to <bold><italic>&#x003b2;</italic></bold><sup>RCC</sup>.</p><p id="P15">Following <xref rid="R12" ref-type="bibr">Kurland and Heagerty (2005)</xref>, consider the vector-estimating equation
<disp-formula id="FD3"><mml:math id="M17" display="block" overflow="scroll"><mml:mi>U</mml:mi><mml:mo stretchy="true">(</mml:mo><mml:msup><mml:mi mathvariant="bold-italic">&#x003b2;</mml:mi><mml:mtext>RCC</mml:mtext></mml:msup><mml:mo stretchy="true">)</mml:mo><mml:mo>=</mml:mo><mml:munderover><mml:mo>&#x02211;</mml:mo><mml:mrow><mml:mi>i</mml:mi><mml:mo>=</mml:mo><mml:mn>1</mml:mn></mml:mrow><mml:mi>n</mml:mi></mml:munderover><mml:munderover><mml:mo>&#x02211;</mml:mo><mml:mrow><mml:mi>j</mml:mi><mml:mo>=</mml:mo><mml:mn>1</mml:mn></mml:mrow><mml:mi>m</mml:mi></mml:munderover><mml:msub><mml:mi mathvariant="bold">d</mml:mi><mml:mtext mathvariant="italic">ij</mml:mtext></mml:msub><mml:msub><mml:mi>C</mml:mi><mml:mtext mathvariant="italic">ij</mml:mtext></mml:msub><mml:mfrac><mml:msub><mml:mi>R</mml:mi><mml:mtext mathvariant="italic">ij</mml:mtext></mml:msub><mml:msub><mml:mi>&#x003c0;</mml:mi><mml:mtext mathvariant="italic">ij</mml:mtext></mml:msub></mml:mfrac><mml:mo stretchy="false">(</mml:mo><mml:msub><mml:mi>Y</mml:mi><mml:mtext mathvariant="italic">ij</mml:mtext></mml:msub><mml:mo>&#x02212;</mml:mo><mml:msubsup><mml:mi>&#x003bc;</mml:mi><mml:mtext mathvariant="italic">ij</mml:mtext><mml:mtext>RCC</mml:mtext></mml:msubsup><mml:mo stretchy="false">)</mml:mo></mml:math></disp-formula>We adopt the convention that if <italic>C<sub>ij</sub></italic> = 0, then the summand for individual <italic>i</italic> at time point <italic>j</italic> equals 0. The IPW probability <italic>&#x003c0;<sub>ij</sub></italic> is generally unknown in practice but can be consistently estimated if the dropout mechanism model is correctly specified. Let <italic>&#x003c0;&#x00302;<sub>ij</sub></italic> represent a consistent estimator of <italic>&#x003c0;<sub>ij</sub></italic>, and let <bold><italic>&#x003b2;&#x00302;</italic></bold> denote the solution to <italic>U</italic> (<bold><italic>&#x003b2;</italic></bold><sup>RCC</sup>) = <bold>0</bold> under MAR when <italic>&#x003c0;&#x00302;<sub>ij</sub></italic> is substituted for <italic>&#x003c0;<sub>ij</sub></italic>. The estimator <bold><italic>&#x003b2;&#x00302;</italic></bold> is consistent and asymptotically multivariate normal for <bold><italic>&#x003b2;</italic></bold><sup>RCC</sup> (<xref rid="R20" ref-type="bibr">Robins, Rotnitzky, and Zhao 1995</xref>). The 
<monospace>glm</monospace> command is ideal for calculating <bold><italic>&#x003b2;&#x00302;</italic></bold> because by default, it assumes the independence working correlation structure required by RCC, and it allows the user to specify time-varying IPWs through the 
<monospace>pweight</monospace> qualifier. The empirical sandwich estimator of the variance of <bold><italic>&#x003b2;&#x00302;</italic></bold> is readily available by specifying the 
<monospace>glm</monospace> command option 
<monospace>vce</monospace>(
<monospace>cluster</monospace>
<italic>clustvar</italic>), where <italic>clustvar</italic> is the variable that identifies individuals. When computed as if the IPWs are known and fixed, the empirical sandwich estimator is expected to be conservative in general (<xref rid="R19" ref-type="bibr">Robins, Hern&#x000e1;n, and Brumback 2000</xref>; <xref rid="R18" ref-type="bibr">Robins 2000</xref>; <xref rid="R24" ref-type="bibr">Wooldridge 2007</xref>). Thus 95% Wald confidence intervals constructed using the empirical sandwich estimator should in general have a coverage probability for <bold><italic>&#x003b2;</italic></bold><sup>RCC</sup> of at least 95%.</p></sec></sec><sec id="S6"><title>3 The xtrccipw command</title><sec id="S7"><title>3.1 Description</title><p id="P16">The 
<monospace>xtrccipw</monospace> command estimates time-specific weights equal to the inverse of the nondropout probability conditioning on continuation. This command uses either the 
<monospace>logit</monospace> or the 
<monospace>probit</monospace> command to estimate IPWs. The user may then specify that 
<monospace>xtrccipw</monospace> run 
<monospace>glm</monospace> with the 
<monospace>pweight</monospace> qualifier and the 
<monospace>vce</monospace>(
<monospace>cluster</monospace>
<italic>clustvar</italic>) option to calculate RCC estimates of the outcome-model parameters, along with variance estimates constructed using the empirical sandwich estimator. The 
<monospace>xtrccipw</monospace> command runs under Stata 14.</p><p id="P17">The rest of this section is organized as follows. We describe and illustrate input dataset requirements in an example. We then present the command syntax, along with definitions of all relevant variables and options. Finally, we describe the displayed outputs and stored results.</p></sec><sec id="S8"><title>3.2 Input datasets</title><p id="P18">The 
<monospace>xtrccipw</monospace> command accepts datasets in Stata long format (that is, each row corresponds to one observation at one measurement time point). It then creates indicator variables for truncation and dropout based on the supplied variables for measurement time, truncation time, and outcome-model outcome.</p><p id="P19">The dataset must include the following variables: unique individual identifiers, measurement time, measurement time index, outcome, and dropout-model covariates. Each row must provide values for unique individual identifiers, measurement time, and measurement time index. For each individual, unique individual identifier values must be identical on all rows, and rows for all possible measurement times and time indices must be included to create truncation and dropout indicators, regardless of outcome value being available or unavailable on any given row (that is, because of dropout or truncation). At the current time index, values for all dropout-model covariates (except for past outcomes) must be provided if an individual had not dropped out by the previous time index (that is, if an outcome value was provided at the previous time index) and had not been truncated by the current time index. The dataset must additionally include a variable for truncation time if truncation occurred for any individual, in which case an individual&#x02019;s truncation time must be identical across all of that individual&#x02019;s rows. Truncation time must be left missing on all rows for each individual without a truncation time.</p></sec><sec id="S9"><title>3.3 Syntax</title><p id="P20">
<preformat>
xtrccipw <italic>outcomevar</italic> [<italic>if</italic>], <underline>id</underline>var(<italic>varlist</italic>) <underline>time</underline>var(<italic>varname</italic>)
   <underline>timeidx</underline>var(<italic>varname</italic>)  <underline>gen</underline>erate(<italic>newvar</italic>)  [timeidxf(<italic>&#x029e3;</italic>) timeidxl(&#x029e3;)
   <underline>trtime</underline>var(<italic>varname</italic>) <underline>link</underline>fxn(<italic>link</italic>) <underline>td</underline>indepvars(<italic>varlist</italic>)
   <underline>ti</underline>indepvars(<italic>varlist</italic>) mcar <underline>lag</underline>reduced(&#x029e3;) <underline>glmv</underline>ars(<italic>indepvars</italic>)
   <underline>glmfam</underline>ily(<italic>familyname</italic>)  <underline>glml</underline>ink(<italic>linkname</italic>)]
</preformat><italic>outcomevar</italic> is the outcome-model outcome variable used as a covariate in the dropout model. If <italic>outcomevar</italic> is an indicator or categorical factor variable, it must be preceded with &#x0201c;
<monospace>i</monospace>.&#x0201d;. The other unary operators &#x0201c;
<monospace>c</monospace>.&#x0201d; and &#x0201c;
<monospace>o</monospace>.&#x0201d; are not allowed.</p></sec><sec id="S10"><title>3.4 Options</title><p id="P21">
<monospace>idvar</monospace>(<italic>varlist</italic>) defines variables used to uniquely identify individuals (for example, subjects or panels). This is analogous to <italic>panelvar</italic> in 
<monospace>xtset</monospace>. If the 
<monospace>glmvars()</monospace> option is specified, then the call to 
<monospace>glm</monospace> will include the 
<monospace>vce</monospace>(
<monospace>cluster</monospace>
<italic>clustvar</italic>) option. 
<monospace>idvar()</monospace> is required.</p><p id="P22">
<monospace>timevar</monospace>(<italic>varname</italic>) defines the variable representing the measurement time (for example, visit date). This is analogous to <italic>timevar</italic> in 
<monospace>xtset</monospace>. 
<monospace>timevar()</monospace> is required.</p><p id="P23">
<monospace>timeidxvar</monospace>(<italic>varname</italic>) defines the variable representing the measurement time index (for example, visit number). All index values must be integers. 
<monospace>timeidxvar()</monospace> is required.</p><p id="P24">
<monospace>generate</monospace>(<italic>newvar</italic>) defines the variable name for the estimated IPW. 
<monospace>generate()</monospace> is required.</p><p id="P25">
<monospace>timeidxf</monospace>(&#x029e3;) denotes the first time-index value, which must be an integer, to be used in the outcome-model analysis. This must be specified along with 
<monospace>timeidxl()</monospace>. The default is the first nonmissing index value found in the current dataset after 
<monospace>if</monospace> is applied.</p><p id="P26">
<monospace>timeidxl</monospace>(&#x029e3;) denotes the last time index value, which must be an integer, to be used in the outcome-model analysis. This must be specified along with 
<monospace>timeidxf()</monospace>. The default is the last nonmissing index value found in the current dataset after 
<monospace>if</monospace> is applied.</p><p id="P27">
<monospace>trtimevar</monospace>(<italic>varname</italic>) denotes the truncation time (for example, truncation date). This must have the same scale as 
<monospace>timevar()</monospace>. The default is no truncation.</p><p id="P28">
<monospace>linkfxn</monospace>(<italic>link</italic>) specifies the dropout-model binary link function and only accepts the values 
<monospace>logit</monospace> or 
<monospace>probit</monospace>. The default is 
<monospace>linkfxn(logit)</monospace>.</p><p id="P29">
<monospace>tdindepvars</monospace>(<italic>varlist</italic>) defines the additional dropout-model time-dependent variables (that is, distinct from the time-dependent outcome-model outcome variable). Use spaces to separate multiple variables. Each indicator or categorical factor-variable argument in 
<monospace>tdindepvars()</monospace> must be preceded with &#x0201c;
<monospace>i</monospace>.&#x0201d;. The other unary operators &#x0201c;
<monospace>c</monospace>.&#x0201d; and &#x0201c;
<monospace>o</monospace>.&#x0201d; are not allowed, and neither is variable-interaction notation (that is, &#x0201c;
<monospace>#</monospace>&#x0201d; or &#x0201c;
<monospace>##</monospace>&#x0201d;). A variable representing the interaction between two variables must be created and included as a distinct variable. The <italic>varlist</italic> syntax is otherwise identical to the <italic>indepvars</italic> syntax for the 
<monospace>logit</monospace> or 
<monospace>probit</monospace> command. For example, suppose we have two time-dependent binary variables, that is, <italic>x</italic> and <italic>y</italic>, and the continuous variable <italic>z</italic>. If we wish to model dropout dependent on <italic>x, y</italic>, and <italic>z</italic>, the interaction between <italic>x</italic> and <italic>y</italic>, and the interaction between <italic>x</italic> and <italic>z</italic>, we would first create the interaction variables, for example, 
<monospace>generate xy = x * y</monospace> and 
<monospace>generate xz = x * z</monospace>. Then, we would correspondingly type something like 
<monospace>tdindepvars(i.x i.y i.xy z xz)</monospace>. The default is no additional time-dependent variables.</p><p id="P30">
<monospace>tiindepvars</monospace>(<italic>varlist</italic>) defines the dropout-model time-independent variables. The same description as that for 
<monospace>tdindepvars()</monospace> applies. The default is no additional time-independent variables.</p><p id="P31">
<monospace>mcar</monospace> defines whether to use the full MCAR model. This option cannot be specified with 
<monospace>lagreduced()</monospace>. The default is the full MAR model.</p><p id="P32">
<monospace>lagreduced</monospace>(&#x029e3;) defines whether and how to use the reduced dropout model. The number of lags, that is, &#x029e3;, can range from 1 to <italic>m</italic> &#x02212; 1, where <italic>m</italic> is the number of scheduled study time points. However, specifying <italic>m</italic>&#x02212;1 lags is identical to specifying the full MAR model. To specify the reduced MCAR model, type 
<monospace>lagreduced(0)</monospace>. This option cannot be specified with 
<monospace>mcar</monospace>. The default is the full MAR model.</p><p id="P33">
<monospace>glmvars</monospace>(<italic>indepvars</italic>) defines the outcome-model independent variables for 
<monospace>glm</monospace>.</p><p id="P34">
<monospace>glmfamily</monospace>(<italic>familyname</italic>) specifies the distribution of <italic>outcomevar</italic> for 
<monospace>glm</monospace>. The default is 
<monospace>glmfamily(gaussian)</monospace>.</p><p id="P35">
<monospace>glmlink</monospace>(<italic>linkname</italic>) specifies the link function for 
<monospace>glm</monospace>. The default is the canonical link for the specified 
<monospace>glmfamily()</monospace>.</p><p id="P36">An example dataset is illustrated in <xref ref-type="table" rid="T1">table 1</xref>. The variable names correspond to a unique individual identifier 
<monospace>idvar</monospace>, measurement time 
<monospace>timevar</monospace>, measurement time index 
<monospace>timeidxvar</monospace>, continuous outcome 
<monospace>outcomevar</monospace>, dropout-model time-dependent continuous covariate 
<monospace>tdindepvar</monospace>, dropout-model time-independent binary covariate 
<monospace>tiindepvar</monospace>, and truncation time 
<monospace>trtimevar</monospace>. The variables <italic>C<sub>j</sub></italic>, <italic>R<sub>j</sub></italic>, and <italic>S</italic> (that is, the truncation indicator, dropout indicator, and number of time points before truncation, respectively) are included only to help illustrate the example in section 2.1, but 
<monospace>xtrccipw</monospace> does not output them.</p></sec><sec id="S11"><title>3.5 Displayed outputs</title><p id="P37">
<monospace>xtrccipw</monospace> displays two outputs. The first is a list of all arguments for verification by the user. The second is a tabulation of the observed values of the 
<monospace>xtrccipw_ec</monospace> variable (where _
<monospace>ec</monospace> stands for &#x0201c;error code&#x0201d;), which indicates the number of nonzero observations at each time point for which dropout regression and subsequent probability prediction are successful, or for which there are errors. The 
<monospace>xtrccipw_ec</monospace> variable is equal to 0 if regression and prediction are successful, 1 if regression fails because there is either no dropout or all dropout at that time point, 2 if regression fails because all eligible observations are dropped because of regression collinearities, and 3 if regression succeeds but prediction fails. In any of the failure cases, the dropout probability is estimated as the empirical mean of dropout in the risk set (that is, among observations with <italic>R</italic><sub><italic>i</italic>(<italic>j</italic>&#x02212;1)</sub> = 1).</p></sec><sec id="S12"><title>3.6 Stored results</title><p id="P38">The command attaches five variables to the input dataset. The outcome variable used in estimating the dropout probability while accounting for truncation is stored as 
<monospace>xtrccipw</monospace>_<italic>outcomevar</italic>. The value of this variable can differ from that of <italic>outcomevar</italic> in the following way: if a truncation event and outcome are both recorded at time point <italic>j</italic>, then 
<monospace>xtrccipw</monospace> treats truncation as having occurred before the outcome and sets 
<monospace>xtrccipw</monospace>_<italic>outcomevar</italic> as undefined (that is, &#x0201c;&#x02024;&#x0201d; in Stata syntax). The indicators for truncation (that is, <italic>C</italic> represented as 
<monospace>xtrccipwCi</monospace>) and dropout (that is, <italic>R</italic> represented as 
<monospace>xtrccipwRi</monospace>) are also stored, as are the estimated IPWs (that is, the <italic>newvar</italic> specified by 
<monospace>generate</monospace>(<italic>newvar</italic>)). Finally, the 
<monospace>xtrccipw_ec</monospace> variable is also output.</p></sec></sec><sec id="S13"><title>4 Example</title><p id="P39">Our example data came from the National Longitudinal Survey of Young Women (NLSYW). We took a subsample of an available Stata dataset for our analysis, generated truncation, and then analyzed a binary outcome from this analysis sample.</p><p id="P40">We started with 
<monospace>nlswork5.dta</monospace>, a subsample of 4,711 young women ages 14&#x02013;26 in 1968 that was originally derived to illustrate how to use the 
<monospace>xt</monospace> commands. These data are composed of &#x0201c;women in years when employed, not enrolled in school and evidently having completed their education, and with wages in excess of $1/hour but less than $700/hour&#x0201d; (see [XT] <bold>xt</bold>). The longitudinal binary outcome of interest was union membership 
<monospace>union</monospace> (
<monospace>1</monospace> if yes, 
<monospace>0</monospace> if no). The covariates we used were age, 
<monospace>age</monospace>; ln(wage/gross national product deflator), 
<monospace>ln_wage</monospace>; total work experience, 
<monospace>ttl_exp</monospace>; birth year, 
<monospace>birth_yr</monospace>; and college graduate indicator, 
<monospace>collgrad</monospace> (
<monospace>1</monospace> if yes, 
<monospace>0</monospace> if no). The identifier variables were NLSYW ID (
<monospace>idcode</monospace>) and interview year (
<monospace>year</monospace>).</p><p id="P41">For our analysis, we selected the 
<monospace>nlswork5.dta</monospace> subsample of women with nonmissing values for any of these outcomes or covariates from years 70 (that is, 1970) through 73, 77, 78, and 80, which gave us 357 individuals. We then generated truncation at follow-up years; no truncation was generated for baseline year 70. Truncation was generated with probability 0.2 if union membership in the previous year was missing. Otherwise, truncation was generated with higher probability if an individual was a union member in the previous year and with lower probability if she was not a member. The degree of increase or decrease in truncation probability itself increased over time. In the <xref ref-type="app" rid="APP1">Appendix</xref>, we show the commands used to create 
<monospace>nlswork5-xtrccipw.dta</monospace>.</p><p id="P42">The following output characterizes the analysis dataset:
<preformat>
. use nlswork5_xtrccipw
(NLS: Young women 14&#x02013;26 years of age in 1968. Example dataset for xtrccipw.)
. describe
</preformat>
<table-wrap id="T3" position="anchor" orientation="portrait"><table frame="below" rules="none"><tbody><tr><td align="left" colspan="4" rowspan="1">Contains data from nlswork5_xtrccipw.dta</td><td align="left" rowspan="1" colspan="1"/></tr><tr><td align="left" rowspan="1" colspan="1">&#x000a0;&#x000a0;&#x000a0;&#x000a0;obs:</td><td align="left" rowspan="1" colspan="1">2,499</td><td align="left" rowspan="1" colspan="1"/><td align="left" rowspan="1" colspan="1"/><td align="left" rowspan="1" colspan="1">NLS: Young women 14&#x02013;26 years of age in 1968. Example dataset for xtrccipw.</td></tr><tr><td align="left" rowspan="1" colspan="1">&#x000a0;&#x000a0;&#x000a0;vars:</td><td align="left" rowspan="1" colspan="1">10</td><td align="left" rowspan="1" colspan="1"/><td align="left" rowspan="1" colspan="1"/><td align="left" rowspan="1" colspan="1">9 Jan 2017 07:45</td></tr><tr><td align="left" rowspan="1" colspan="1">&#x000a0;&#x000a0;&#x000a0;size:</td><td align="left" rowspan="1" colspan="1">42,483</td><td align="left" rowspan="1" colspan="1"/><td align="left" rowspan="1" colspan="1"/><td align="left" rowspan="1" colspan="1"/></tr><tr><td align="left" colspan="5" valign="bottom" rowspan="1">
<hr/></td></tr><tr><td align="left" rowspan="1" colspan="1">variable name</td><td align="left" rowspan="1" colspan="1">storage type</td><td align="left" rowspan="1" colspan="1">display format</td><td align="left" rowspan="1" colspan="1">value label</td><td align="left" rowspan="1" colspan="1">variable label</td></tr><tr><td align="left" colspan="5" valign="bottom" rowspan="1">
<hr/></td></tr><tr><td align="left" rowspan="1" colspan="1">idcode</td><td align="left" rowspan="1" colspan="1">int</td><td align="left" rowspan="1" colspan="1">%8.0g</td><td align="left" rowspan="1" colspan="1"/><td align="left" rowspan="1" colspan="1">NLS ID</td></tr><tr><td align="left" rowspan="1" colspan="1">year</td><td align="left" rowspan="1" colspan="1">byte</td><td align="left" rowspan="1" colspan="1">%8.0g</td><td align="left" rowspan="1" colspan="1"/><td align="left" rowspan="1" colspan="1">interview year</td></tr><tr><td align="left" rowspan="1" colspan="1">yearidx</td><td align="left" rowspan="1" colspan="1">byte</td><td align="left" rowspan="1" colspan="1">%9.0g</td><td align="left" rowspan="1" colspan="1"/><td align="left" rowspan="1" colspan="1">interview year</td></tr><tr><td align="left" rowspan="1" colspan="1">truncyear</td><td align="left" rowspan="1" colspan="1">byte</td><td align="left" rowspan="1" colspan="1">%9.0g</td><td align="left" rowspan="1" colspan="1"/><td align="left" rowspan="1" colspan="1"/></tr><tr><td align="left" rowspan="1" colspan="1">union</td><td align="left" rowspan="1" colspan="1">byte</td><td align="left" rowspan="1" colspan="1">%8.0g</td><td align="left" rowspan="1" colspan="1"/><td align="left" rowspan="1" colspan="1">1 if union</td></tr><tr><td align="left" rowspan="1" colspan="1">age</td><td align="left" rowspan="1" colspan="1">byte</td><td align="left" rowspan="1" colspan="1">%8.0g</td><td align="left" rowspan="1" colspan="1"/><td align="left" rowspan="1" colspan="1">age in current year</td></tr><tr><td align="left" rowspan="1" colspan="1">ln_wage</td><td align="left" rowspan="1" colspan="1">float</td><td align="left" rowspan="1" colspan="1">%9.0g</td><td align="left" rowspan="1" colspan="1"/><td align="left" rowspan="1" colspan="1">ln(wage/GNP deflator)</td></tr><tr><td align="left" rowspan="1" colspan="1">ttl_exp</td><td align="left" rowspan="1" colspan="1">float</td><td align="left" rowspan="1" colspan="1">%9.0g</td><td align="left" rowspan="1" colspan="1"/><td align="left" rowspan="1" colspan="1">total work experience</td></tr><tr><td align="left" rowspan="1" colspan="1">birth_yr</td><td align="left" rowspan="1" colspan="1">byte</td><td align="left" rowspan="1" colspan="1">%8.0g</td><td align="left" rowspan="1" colspan="1"/><td align="left" rowspan="1" colspan="1">birth year</td></tr><tr><td align="left" rowspan="1" colspan="1">collgrad</td><td align="left" rowspan="1" colspan="1">byte</td><td align="left" rowspan="1" colspan="1">%8.0g</td><td align="left" rowspan="1" colspan="1"/><td align="left" rowspan="1" colspan="1">1 if college graduate</td></tr></tbody></table><table-wrap-foot><fn id="TFN1"><p id="P43">Sorted by: idcode yearidx</p></fn></table-wrap-foot></table-wrap>The following individuals illustrate the three possible truncation and dropout patterns. Individual 5 experienced dropout but not truncation. Individual 20 experienced neither dropout nor truncation. Individual 126 experienced both dropout and truncation.
<preformat>
. list idcode year truncyear union age ln_wage ttl_exp birth_yr collgrad if
&#x0003e; inlist(idcode, 5, 20, 126), sepby(idcode) abbreviate(5)
</preformat>
<table-wrap id="T4" position="anchor" orientation="portrait"><table frame="box" rules="groups"><thead><tr><th align="right" rowspan="1" colspan="1"/><th align="right" rowspan="1" colspan="1">idc~e</th><th align="right" rowspan="1" colspan="1">year</th><th align="right" rowspan="1" colspan="1">tru~r</th><th align="right" rowspan="1" colspan="1">union</th><th align="right" rowspan="1" colspan="1">age</th><th align="right" rowspan="1" colspan="1">ln_wage</th><th align="right" rowspan="1" colspan="1">ttl_exp</th><th align="right" rowspan="1" colspan="1">bir~r</th><th align="right" rowspan="1" colspan="1">col~d</th></tr></thead><tbody><tr><td align="right" rowspan="1" colspan="1">15.</td><td align="right" rowspan="1" colspan="1">5</td><td align="right" rowspan="1" colspan="1">70</td><td align="right" rowspan="1" colspan="1">.</td><td align="right" rowspan="1" colspan="1">0</td><td align="right" rowspan="1" colspan="1">24</td><td align="right" rowspan="1" colspan="1">1.820858</td><td align="right" rowspan="1" colspan="1">3.076923</td><td align="right" rowspan="1" colspan="1">45</td><td align="right" rowspan="1" colspan="1">0</td></tr><tr><td align="right" rowspan="1" colspan="1">16.</td><td align="right" rowspan="1" colspan="1">5</td><td align="right" rowspan="1" colspan="1">71</td><td align="right" rowspan="1" colspan="1">.</td><td align="right" rowspan="1" colspan="1">0</td><td align="right" rowspan="1" colspan="1">25</td><td align="right" rowspan="1" colspan="1">1.858522</td><td align="right" rowspan="1" colspan="1">4.038462</td><td align="right" rowspan="1" colspan="1">45</td><td align="right" rowspan="1" colspan="1">0</td></tr><tr><td align="right" rowspan="1" colspan="1">17.</td><td align="right" rowspan="1" colspan="1">5</td><td align="right" rowspan="1" colspan="1">72</td><td align="right" rowspan="1" colspan="1">.</td><td align="right" rowspan="1" colspan="1">0</td><td align="right" rowspan="1" colspan="1">26</td><td align="right" rowspan="1" colspan="1">1.979301</td><td align="right" rowspan="1" colspan="1">5.038462</td><td align="right" rowspan="1" colspan="1">45</td><td align="right" rowspan="1" colspan="1">0</td></tr><tr><td align="right" rowspan="1" colspan="1">18.</td><td align="right" rowspan="1" colspan="1">5</td><td align="right" rowspan="1" colspan="1">73</td><td align="right" rowspan="1" colspan="1">.</td><td align="right" rowspan="1" colspan="1">0</td><td align="right" rowspan="1" colspan="1">27</td><td align="right" rowspan="1" colspan="1">1.990412</td><td align="right" rowspan="1" colspan="1">6.038462</td><td align="right" rowspan="1" colspan="1">45</td><td align="right" rowspan="1" colspan="1">0</td></tr><tr><td align="right" rowspan="1" colspan="1">19.</td><td align="right" rowspan="1" colspan="1">5</td><td align="right" rowspan="1" colspan="1">77</td><td align="right" rowspan="1" colspan="1">.</td><td align="right" rowspan="1" colspan="1">0</td><td align="right" rowspan="1" colspan="1">31</td><td align="right" rowspan="1" colspan="1">1.937521</td><td align="right" rowspan="1" colspan="1">7.576923</td><td align="right" rowspan="1" colspan="1">45</td><td align="right" rowspan="1" colspan="1">0</td></tr><tr><td align="right" rowspan="1" colspan="1">20.</td><td align="right" rowspan="1" colspan="1">5</td><td align="right" rowspan="1" colspan="1">78</td><td align="right" rowspan="1" colspan="1">.</td><td align="right" rowspan="1" colspan="1">.</td><td align="right" rowspan="1" colspan="1">32</td><td align="right" rowspan="1" colspan="1">2.070492</td><td align="right" rowspan="1" colspan="1">7.846154</td><td align="right" rowspan="1" colspan="1">45</td><td align="right" rowspan="1" colspan="1">0</td></tr><tr><td align="right" rowspan="1" colspan="1">21.</td><td align="right" rowspan="1" colspan="1">5</td><td align="right" rowspan="1" colspan="1">80</td><td align="right" rowspan="1" colspan="1">.</td><td align="right" rowspan="1" colspan="1">.</td><td align="right" rowspan="1" colspan="1">34</td><td align="right" rowspan="1" colspan="1">1.830269</td><td align="right" rowspan="1" colspan="1">9.346154</td><td align="right" rowspan="1" colspan="1">45</td><td align="right" rowspan="1" colspan="1">0</td></tr><tr><td align="right" colspan="10" valign="bottom" rowspan="1">
<hr/></td></tr><tr><td align="right" rowspan="1" colspan="1">43.</td><td align="right" rowspan="1" colspan="1">20</td><td align="right" rowspan="1" colspan="1">70</td><td align="right" rowspan="1" colspan="1">.</td><td align="right" rowspan="1" colspan="1">0</td><td align="right" rowspan="1" colspan="1">21</td><td align="right" rowspan="1" colspan="1">2.01878</td><td align="right" rowspan="1" colspan="1">.5</td><td align="right" rowspan="1" colspan="1">48</td><td align="right" rowspan="1" colspan="1">0</td></tr><tr><td align="right" rowspan="1" colspan="1">44.</td><td align="right" rowspan="1" colspan="1">20</td><td align="right" rowspan="1" colspan="1">71</td><td align="right" rowspan="1" colspan="1">.</td><td align="right" rowspan="1" colspan="1">0</td><td align="right" rowspan="1" colspan="1">22</td><td align="right" rowspan="1" colspan="1">2.081666</td><td align="right" rowspan="1" colspan="1">1.5</td><td align="right" rowspan="1" colspan="1">48</td><td align="right" rowspan="1" colspan="1">0</td></tr><tr><td align="right" rowspan="1" colspan="1">45.</td><td align="right" rowspan="1" colspan="1">20</td><td align="right" rowspan="1" colspan="1">72</td><td align="right" rowspan="1" colspan="1">.</td><td align="right" rowspan="1" colspan="1">0</td><td align="right" rowspan="1" colspan="1">23</td><td align="right" rowspan="1" colspan="1">2.117261</td><td align="right" rowspan="1" colspan="1">2.403846</td><td align="right" rowspan="1" colspan="1">48</td><td align="right" rowspan="1" colspan="1">0</td></tr><tr><td align="right" rowspan="1" colspan="1">46.</td><td align="right" rowspan="1" colspan="1">20</td><td align="right" rowspan="1" colspan="1">73</td><td align="right" rowspan="1" colspan="1">.</td><td align="right" rowspan="1" colspan="1">1</td><td align="right" rowspan="1" colspan="1">24</td><td align="right" rowspan="1" colspan="1">2.099896</td><td align="right" rowspan="1" colspan="1">3.442308</td><td align="right" rowspan="1" colspan="1">48</td><td align="right" rowspan="1" colspan="1">0</td></tr><tr><td align="right" rowspan="1" colspan="1">47.</td><td align="right" rowspan="1" colspan="1">20</td><td align="right" rowspan="1" colspan="1">77</td><td align="right" rowspan="1" colspan="1">.</td><td align="right" rowspan="1" colspan="1">0</td><td align="right" rowspan="1" colspan="1">28</td><td align="right" rowspan="1" colspan="1">2.10058</td><td align="right" rowspan="1" colspan="1">5.416667</td><td align="right" rowspan="1" colspan="1">48</td><td align="right" rowspan="1" colspan="1">0</td></tr><tr><td align="right" rowspan="1" colspan="1">48.</td><td align="right" rowspan="1" colspan="1">20</td><td align="right" rowspan="1" colspan="1">78</td><td align="right" rowspan="1" colspan="1">.</td><td align="right" rowspan="1" colspan="1">0</td><td align="right" rowspan="1" colspan="1">29</td><td align="right" rowspan="1" colspan="1">1.990396</td><td align="right" rowspan="1" colspan="1">6.493589</td><td align="right" rowspan="1" colspan="1">48</td><td align="right" rowspan="1" colspan="1">0</td></tr><tr><td align="right" rowspan="1" colspan="1">49.</td><td align="right" rowspan="1" colspan="1">20</td><td align="right" rowspan="1" colspan="1">80</td><td align="right" rowspan="1" colspan="1">.</td><td align="right" rowspan="1" colspan="1">0</td><td align="right" rowspan="1" colspan="1">31</td><td align="right" rowspan="1" colspan="1">1.958695</td><td align="right" rowspan="1" colspan="1">8.378204</td><td align="right" rowspan="1" colspan="1">48</td><td align="right" rowspan="1" colspan="1">0</td></tr><tr><td align="right" colspan="10" valign="bottom" rowspan="1">
<hr/></td></tr><tr><td align="right" rowspan="1" colspan="1">64.</td><td align="right" rowspan="1" colspan="1">126</td><td align="right" rowspan="1" colspan="1">70</td><td align="right" rowspan="1" colspan="1">77</td><td align="right" rowspan="1" colspan="1">0</td><td align="right" rowspan="1" colspan="1">21</td><td align="right" rowspan="1" colspan="1">1.657229</td><td align="right" rowspan="1" colspan="1">2.01282</td><td align="right" rowspan="1" colspan="1">48</td><td align="right" rowspan="1" colspan="1">0</td></tr><tr><td align="right" rowspan="1" colspan="1">65.</td><td align="right" rowspan="1" colspan="1">126</td><td align="right" rowspan="1" colspan="1">71</td><td align="right" rowspan="1" colspan="1">77</td><td align="right" rowspan="1" colspan="1">0</td><td align="right" rowspan="1" colspan="1">22</td><td align="right" rowspan="1" colspan="1">1.676201</td><td align="right" rowspan="1" colspan="1">2.99359</td><td align="right" rowspan="1" colspan="1">48</td><td align="right" rowspan="1" colspan="1">0</td></tr><tr><td align="right" rowspan="1" colspan="1">66.</td><td align="right" rowspan="1" colspan="1">126</td><td align="right" rowspan="1" colspan="1">72</td><td align="right" rowspan="1" colspan="1">77</td><td align="right" rowspan="1" colspan="1">0</td><td align="right" rowspan="1" colspan="1">23</td><td align="right" rowspan="1" colspan="1">1.943153</td><td align="right" rowspan="1" colspan="1">3.99359</td><td align="right" rowspan="1" colspan="1">48</td><td align="right" rowspan="1" colspan="1">0</td></tr><tr><td align="right" rowspan="1" colspan="1">67.</td><td align="right" rowspan="1" colspan="1">126</td><td align="right" rowspan="1" colspan="1">73</td><td align="right" rowspan="1" colspan="1">77</td><td align="right" rowspan="1" colspan="1">1</td><td align="right" rowspan="1" colspan="1">24</td><td align="right" rowspan="1" colspan="1">2.159794</td><td align="right" rowspan="1" colspan="1">4.974359</td><td align="right" rowspan="1" colspan="1">48</td><td align="right" rowspan="1" colspan="1">0</td></tr><tr><td align="right" rowspan="1" colspan="1">68.</td><td align="right" rowspan="1" colspan="1">126</td><td align="right" rowspan="1" colspan="1">77</td><td align="right" rowspan="1" colspan="1">77</td><td align="right" rowspan="1" colspan="1">.</td><td align="right" rowspan="1" colspan="1">28</td><td align="right" rowspan="1" colspan="1">2.087653</td><td align="right" rowspan="1" colspan="1">8.25</td><td align="right" rowspan="1" colspan="1">48</td><td align="right" rowspan="1" colspan="1">0</td></tr><tr><td align="right" rowspan="1" colspan="1">69.</td><td align="right" rowspan="1" colspan="1">126</td><td align="right" rowspan="1" colspan="1">78</td><td align="right" rowspan="1" colspan="1">77</td><td align="right" rowspan="1" colspan="1">.</td><td align="right" rowspan="1" colspan="1">29</td><td align="right" rowspan="1" colspan="1">2.137434</td><td align="right" rowspan="1" colspan="1">9.25</td><td align="right" rowspan="1" colspan="1">48</td><td align="right" rowspan="1" colspan="1">0</td></tr><tr><td align="right" rowspan="1" colspan="1">70.</td><td align="right" rowspan="1" colspan="1">126</td><td align="right" rowspan="1" colspan="1">80</td><td align="right" rowspan="1" colspan="1">77</td><td align="right" rowspan="1" colspan="1">.</td><td align="right" rowspan="1" colspan="1">31</td><td align="right" rowspan="1" colspan="1">2.026384</td><td align="right" rowspan="1" colspan="1">11.33333</td><td align="right" rowspan="1" colspan="1">48</td><td align="right" rowspan="1" colspan="1">0</td></tr></tbody></table></table-wrap></p><p id="P44">We now analyze the example dataset. We regressed 
<monospace>union</monospace> on 
<monospace>age</monospace>, 
<monospace>ln_wage</monospace>, and 
<monospace>birth_yr</monospace>. We modeled dropout on 
<monospace>ttl_exp</monospace> and 
<monospace>collgrad</monospace> using a probit link. We also requested that 
<monospace>xtrccipw</monospace> run the RCC outcome-model regression for union membership. The IPW variable was generated as 
<monospace>ipw_full</monospace>.
<preformat>
* RCC and full dropout model.
. xtrccipw i.union, idvar(idcode) timevar(year) timeidxvar(yearidx)
&#x0003e; generate(ipw_full) trtimevar(truncyear) linkfxn(probit) tdindepvars(ttl_exp)
&#x0003e; tiindepvars(i.collgrad) glmvars(age ln_wage birth_yr) glmfamily(binomial)
</preformat></p><p id="P45">The 
<monospace>xtrccipw</monospace> arguments were output to the Stata Results window for verification. Here 
<monospace>timeidxf</monospace> and 
<monospace>timeidxl</monospace> took on values derived from the dataset because they were not specified. The dropout-model regression result for each month can also be quickly scanned for errors using the 
<monospace>xtrccipw_ec</monospace> variable.
<preformat>
outcomevar = i.union
idvar = idcode
timevar = year
timeidxvar = yearidx
generate = ipw_full
timeidxf = 1
timeidxl = 7
trtimevar = truncyear
linkfxn = probit
tdindepvars = ttl_exp
tiindepvars = i.collgrad
mcar =
lagreduced =
glmvars = age ln_wage birth_yr
glmfamily = binomial
glmlink =
</preformat>
<table-wrap id="T5" position="anchor" orientation="portrait"><table frame="hsides" rules="groups"><thead><tr><th align="right" rowspan="2" valign="top" colspan="1">interview<break/>year</th><th align="right" valign="top" rowspan="1" colspan="1"/><th align="right" valign="top" rowspan="1" colspan="1">xtrccipw_ec</th><th align="right" valign="top" rowspan="1" colspan="1"/></tr><tr><th align="right" valign="top" rowspan="1" colspan="1">0</th><th align="right" valign="top" rowspan="1" colspan="1">1</th><th align="right" valign="top" rowspan="1" colspan="1">3</th></tr></thead><tbody><tr><td align="right" rowspan="1" colspan="1">1</td><td align="right" rowspan="1" colspan="1">357</td><td align="right" rowspan="1" colspan="1"/><td align="right" rowspan="1" colspan="1"/></tr><tr><td align="right" rowspan="1" colspan="1">2</td><td align="right" rowspan="1" colspan="1">159</td><td align="right" rowspan="1" colspan="1"/><td align="right" rowspan="1" colspan="1"/></tr><tr><td align="right" rowspan="1" colspan="1">3</td><td align="right" rowspan="1" colspan="1">111</td><td align="right" rowspan="1" colspan="1"/><td align="right" rowspan="1" colspan="1"/></tr><tr><td align="right" rowspan="1" colspan="1">4</td><td align="right" rowspan="1" colspan="1">79</td><td align="right" rowspan="1" colspan="1"/><td align="right" rowspan="1" colspan="1">10</td></tr><tr><td align="right" rowspan="1" colspan="1">5</td><td align="right" rowspan="1" colspan="1"/><td align="right" rowspan="1" colspan="1">67</td><td align="right" rowspan="1" colspan="1"/></tr><tr><td align="right" rowspan="1" colspan="1">6</td><td align="right" rowspan="1" colspan="1">54</td><td align="right" rowspan="1" colspan="1"/><td align="right" rowspan="1" colspan="1">5</td></tr><tr><td align="right" rowspan="1" colspan="1">7</td><td align="right" rowspan="1" colspan="1">42</td><td align="right" rowspan="1" colspan="1"/><td align="right" rowspan="1" colspan="1">9</td></tr></tbody></table></table-wrap></p><p id="P46">At this point, the IPW 
<monospace>ipw_full</monospace> variable has been calculated and attached to the input dataset. The probability of being a union member was then modeled using a logit link.
<preformat>
Iteration 0:   log pseudolikelihood = &#x02212;711.82082
Iteration 1:   log pseudolikelihood = &#x02212;704.44499
Iteration 2:   log pseudolikelihood = &#x02212;704.40354
Iteration 3:   log pseudolikelihood = &#x02212;704.40354
</preformat>
<table-wrap id="T6" position="anchor" orientation="portrait"><table frame="below" rules="none"><tbody><tr><td align="left" colspan="3" rowspan="1">Generalized linear models</td><td align="right" rowspan="1" colspan="1"/><td align="left" colspan="3" rowspan="1">No. of obs = 670</td></tr><tr><td align="left" colspan="3" rowspan="1">Optimization : ML</td><td align="right" rowspan="1" colspan="1"/><td align="left" colspan="3" rowspan="1">Residual df = 666</td></tr><tr><td align="left" colspan="3" rowspan="1"/><td align="right" rowspan="1" colspan="1"/><td align="left" colspan="3" rowspan="1">Scale parameter = 1</td></tr><tr><td align="left" colspan="3" rowspan="1">Deviance = 1408.807085</td><td align="right" rowspan="1" colspan="1"/><td align="left" colspan="3" rowspan="1">(1/df) Deviance = 2.115326</td></tr><tr><td align="left" colspan="3" rowspan="1">Pearson = 1731.432897</td><td align="right" rowspan="1" colspan="1"/><td align="left" colspan="3" rowspan="1">(1/df) Pearson = 2.599749</td></tr><tr><td align="left" colspan="3" rowspan="1">Variance function: V(u) = u*(1&#x02212;u/1)</td><td align="right" rowspan="1" colspan="1"/><td align="left" colspan="3" rowspan="1">[Binomial]</td></tr><tr><td align="left" colspan="3" rowspan="1">Link function : g(u) = ln(u/(1&#x02212;u))</td><td align="right" rowspan="1" colspan="1"/><td align="left" colspan="3" rowspan="1">[Logit]</td></tr><tr><td align="left" colspan="3" rowspan="1"/><td align="right" rowspan="1" colspan="1"/><td align="left" colspan="3" rowspan="1">AIC = 2.114637</td></tr><tr><td align="left" colspan="3" rowspan="1">Log pseudolikelihood = &#x02212;704.4035425</td><td align="right" rowspan="1" colspan="1"/><td align="left" colspan="3" rowspan="1">BIC = &#x02212;2925.04</td></tr><tr><td align="right" rowspan="1" colspan="1"/><td align="right" rowspan="1" colspan="1"/><td align="right" colspan="5" rowspan="1">(Std. Err. adjusted for 205 clusters in idcode)</td></tr><tr><td align="right" colspan="7" valign="bottom" rowspan="1">
<hr/></td></tr><tr><td align="right" rowspan="1" colspan="1"/><td align="right" rowspan="1" colspan="1"/><td align="right" rowspan="1" colspan="1">Robust</td><td align="right" rowspan="1" colspan="1"/><td align="right" rowspan="1" colspan="1"/><td align="right" rowspan="1" colspan="1"/><td align="right" rowspan="1" colspan="1"/></tr><tr><td align="right" rowspan="1" colspan="1">xtrccipw_union</td><td align="right" rowspan="1" colspan="1">Coef.</td><td align="right" rowspan="1" colspan="1">Std. Err.</td><td align="right" rowspan="1" colspan="1">z</td><td align="right" rowspan="1" colspan="1">P&#x0003e; |z|</td><td align="center" colspan="2" rowspan="1">[95% Conf. Interval]</td></tr><tr><td align="right" colspan="7" valign="bottom" rowspan="1">
<hr/></td></tr><tr><td align="right" rowspan="1" colspan="1">age</td><td align="right" rowspan="1" colspan="1">&#x02212;.1432499</td><td align="right" rowspan="1" colspan="1">.0453955</td><td align="right" rowspan="1" colspan="1">&#x02212;3.16</td><td align="right" rowspan="1" colspan="1">0.002</td><td align="right" rowspan="1" colspan="1">&#x02212;.2322235</td><td align="right" rowspan="1" colspan="1">&#x02212;.0542764</td></tr><tr><td align="right" rowspan="1" colspan="1">ln_wage</td><td align="right" rowspan="1" colspan="1">1.230599</td><td align="right" rowspan="1" colspan="1">.3777844</td><td align="right" rowspan="1" colspan="1">3.26</td><td align="right" rowspan="1" colspan="1">0.001</td><td align="right" rowspan="1" colspan="1">.4901551</td><td align="right" rowspan="1" colspan="1">1.971043</td></tr><tr><td align="right" rowspan="1" colspan="1">birth_yr</td><td align="right" rowspan="1" colspan="1">&#x02212;.0347123</td><td align="right" rowspan="1" colspan="1">.0798514</td><td align="right" rowspan="1" colspan="1">&#x02212;0.43</td><td align="right" rowspan="1" colspan="1">0.664</td><td align="right" rowspan="1" colspan="1">&#x02212;.1912182</td><td align="right" rowspan="1" colspan="1">.1217937</td></tr><tr><td align="right" rowspan="1" colspan="1">_cons</td><td align="right" rowspan="1" colspan="1">1.470027</td><td align="right" rowspan="1" colspan="1">4.487581</td><td align="right" rowspan="1" colspan="1">0.33</td><td align="right" rowspan="1" colspan="1">0.743</td><td align="right" rowspan="1" colspan="1">&#x02212;7.32547</td><td align="right" rowspan="1" colspan="1">10.26552</td></tr></tbody></table></table-wrap>Note that while 893 IPW values were calculated, only 670 were used by 
<monospace>glm</monospace>. This is because at any given time point with a continuing outcome, 
<monospace>xtrccipw</monospace> estimates an IPW regardless of whether the outcome at that time point is missing. In contrast, 
<monospace>glm</monospace> uses only complete cases (that is, nonmissing outcomes), thereby excluding the missing outcomes from its analysis.</p><p id="P47">Excluding 
<monospace>trtimevar(truncyear)</monospace> from the 
<monospace>xtrccipw</monospace> call resulted in truncation being treated like dropout, with the following dropout-model regression error codes and UR results.
<preformat>
. use nlswork5_xtrccipw, clear
(NLS: Young women 14&#x02013;26 years of age in 1968. Example dataset for xtrccipw.)
. xtrccipw i.union, idvar(idcode) timevar(year) timeidxvar(yearidx)
&#x0003e; generate(ipw_full) linkfxn(probit) tdindepvars(ttl_exp)
&#x0003e; tiindepvars(i.collgrad) glmvars(age ln_wage birth_yr) glmfamily(binomial)
  (<italic>output omitted</italic>)
</preformat>
<table-wrap id="T7" position="anchor" orientation="portrait"><table frame="hsides" rules="groups"><thead><tr><th align="right" rowspan="2" valign="top" colspan="1">interview<break/>year</th><th align="center" colspan="2" valign="top" rowspan="1">xtrccipw_ec</th></tr><tr><th align="right" valign="bottom" rowspan="1" colspan="1">0</th><th align="right" valign="bottom" rowspan="1" colspan="1">3</th></tr></thead><tbody><tr><td align="right" rowspan="1" colspan="1">1</td><td align="right" rowspan="1" colspan="1">357</td><td align="right" rowspan="1" colspan="1"/></tr><tr><td align="right" rowspan="1" colspan="1">2</td><td align="right" rowspan="1" colspan="1">205</td><td align="right" rowspan="1" colspan="1"/></tr><tr><td align="right" rowspan="1" colspan="1">3</td><td align="right" rowspan="1" colspan="1">121</td><td align="right" rowspan="1" colspan="1"/></tr><tr><td align="right" rowspan="1" colspan="1">4</td><td align="right" rowspan="1" colspan="1">105</td><td align="right" rowspan="1" colspan="1"/></tr><tr><td align="right" rowspan="1" colspan="1">5</td><td align="right" rowspan="1" colspan="1">6</td><td align="right" rowspan="1" colspan="1">65</td></tr><tr><td align="right" rowspan="1" colspan="1">6</td><td align="right" rowspan="1" colspan="1">54</td><td align="right" rowspan="1" colspan="1">13</td></tr><tr><td align="right" rowspan="1" colspan="1">7</td><td align="right" rowspan="1" colspan="1">42</td><td align="right" rowspan="1" colspan="1">11</td></tr></tbody></table></table-wrap>
<preformat>
Iteration 0:   log pseudolikelihood = &#x02212;997.47372
Iteration 1:   log pseudolikelihood = &#x02212;985.96245
Iteration 2:   log pseudolikelihood = &#x02212;985.88336
Iteration 3:   log pseudolikelihood = &#x02212;985.88336
</preformat>
<table-wrap id="T8" position="anchor" orientation="portrait"><table frame="below" rules="none"><tbody><tr><td align="left" colspan="3" rowspan="1">Generalized linear models</td><td align="right" rowspan="1" colspan="1"/><td align="left" colspan="3" rowspan="1">No. of obs = 670</td></tr><tr><td align="left" colspan="3" rowspan="1">Optimization : ML</td><td align="right" rowspan="1" colspan="1"/><td align="left" colspan="3" rowspan="1">Residual df = 666</td></tr><tr><td align="left" colspan="3" rowspan="1"/><td align="right" rowspan="1" colspan="1"/><td align="left" colspan="3" rowspan="1">Scale parameter = 1</td></tr><tr><td align="left" colspan="3" rowspan="1">Deviance = 1971.766711</td><td align="right" rowspan="1" colspan="1"/><td align="left" colspan="3" rowspan="1">(1/df) Deviance = 2.960611</td></tr><tr><td align="left" colspan="3" rowspan="1">Pearson = 2317.068804</td><td align="right" rowspan="1" colspan="1"/><td align="left" colspan="3" rowspan="1">(1/df) Pearson = 3.479082</td></tr><tr><td align="left" colspan="3" rowspan="1">Variance function: V(u) = u*(1&#x02212;u/1)</td><td align="right" rowspan="1" colspan="1"/><td align="left" colspan="3" rowspan="1">[Binomial]</td></tr><tr><td align="left" colspan="3" rowspan="1">Link function : g(u) = ln(u/(1&#x02212;u))</td><td align="right" rowspan="1" colspan="1"/><td align="left" colspan="3" rowspan="1">[Logit]</td></tr><tr><td align="left" colspan="3" rowspan="1"/><td align="right" rowspan="1" colspan="1"/><td align="left" colspan="3" rowspan="1">AIC = 2.954876</td></tr><tr><td align="left" colspan="3" rowspan="1">Log pseudolikelihood = &#x02212;985.8833555</td><td align="right" rowspan="1" colspan="1"/><td align="left" colspan="3" rowspan="1">BIC = &#x02212;2362.08</td></tr><tr><td align="right" colspan="7" rowspan="1">(Std. Err. adjusted for 205 clusters in idcode)</td></tr><tr><td align="right" colspan="7" valign="bottom" rowspan="1">
<hr/></td></tr><tr><td align="right" rowspan="1" colspan="1"/><td align="right" rowspan="1" colspan="1"/><td align="right" rowspan="1" colspan="1">Robust</td><td align="right" rowspan="1" colspan="1"/><td align="left" rowspan="1" colspan="1"/><td align="right" rowspan="1" colspan="1"/><td align="right" rowspan="1" colspan="1"/></tr><tr><td align="right" rowspan="1" colspan="1">xtrccipw_union</td><td align="right" rowspan="1" colspan="1">Coef.</td><td align="right" rowspan="1" colspan="1">Std. Err.</td><td align="right" rowspan="1" colspan="1">z</td><td align="left" rowspan="1" colspan="1">P&#x0003e;|z|</td><td align="right" colspan="2" rowspan="1">[95% Conf. Interval]</td></tr><tr><td align="right" colspan="7" valign="bottom" rowspan="1">
<hr/></td></tr><tr><td align="right" rowspan="1" colspan="1">age</td><td align="right" rowspan="1" colspan="1">&#x02212;.1602152</td><td align="right" rowspan="1" colspan="1">.0473475</td><td align="right" rowspan="1" colspan="1">&#x02212;3.38</td><td align="left" rowspan="1" colspan="1">0.001</td><td align="right" rowspan="1" colspan="1">&#x02212;.2530145</td><td align="right" rowspan="1" colspan="1">&#x02212;.0674159</td></tr><tr><td align="right" rowspan="1" colspan="1">ln_wage</td><td align="right" rowspan="1" colspan="1">1.377227</td><td align="right" rowspan="1" colspan="1">.4380323</td><td align="right" rowspan="1" colspan="1">3.14</td><td align="left" rowspan="1" colspan="1">0.002</td><td align="right" rowspan="1" colspan="1">.5186997</td><td align="right" rowspan="1" colspan="1">2.235755</td></tr><tr><td align="right" rowspan="1" colspan="1">birth_yr</td><td align="right" rowspan="1" colspan="1">&#x02212;.0227574</td><td align="right" rowspan="1" colspan="1">.0991343</td><td align="right" rowspan="1" colspan="1">&#x02212;0.23</td><td align="left" rowspan="1" colspan="1">0.818</td><td align="right" rowspan="1" colspan="1">&#x02212;.2170571</td><td align="right" rowspan="1" colspan="1">.1715423</td></tr><tr><td align="right" rowspan="1" colspan="1">_cons</td><td align="right" rowspan="1" colspan="1">1.251279</td><td align="right" rowspan="1" colspan="1">5.499011</td><td align="right" rowspan="1" colspan="1">0.23</td><td align="left" rowspan="1" colspan="1">0.820</td><td align="right" rowspan="1" colspan="1">&#x02212;9.526585</td><td align="right" rowspan="1" colspan="1">12.02914</td></tr></tbody></table></table-wrap>Compared with their RCC counterparts, the UR parameter estimates kept the same signs and did not change much in magnitude. Levels of statistical significance also resembled those under RCC.</p><p id="P48">The full and reduced MCAR models were also specified to illustrate how they can produce different results. The following is the output for the corresponding RCC full MCAR model:
<preformat>
. use nlswork5_xtrccipw, clear
(NLS: Young women 14&#x02013;26 years of age in 1968. Example dataset for xtrccipw.)
. xtrccipw i.union, idvar(idcode) timevar(year) timeidxvar(yearidx)
&#x0003e; generate(ipw_mcarfull) trtimevar(truncyear) linkfxn(probit)
&#x0003e; tdindepvars(ttl_exp) tiindepvars(i.collgrad) mcar
&#x0003e; glmvars(age ln_wage birth_yr) glmfamily(binomial)
outcomevar = i.union
idvar = idcode
timevar = year
timeidxvar = yearidx
generate = ipw_mcarfull
timeidxf = 1
timeidxl = 7
trtimevar = truncyear
linkfxn = probit
tdindepvars = ttl_exp
tiindepvars = i.collgrad
mcar = mcar
lagreduced =
glmvars = age ln_wage birth_yr
glmfamily = binomial
glmlink =
</preformat>
<table-wrap id="T9" position="anchor" orientation="portrait"><table frame="hsides" rules="groups"><thead><tr><th align="right" rowspan="2" valign="top" colspan="1">interview<break/>year</th><th align="right" valign="bottom" rowspan="1" colspan="1"/><th align="right" valign="bottom" rowspan="1" colspan="1">xtrccipw_ec</th><th align="right" valign="bottom" rowspan="1" colspan="1"/></tr><tr><th align="right" valign="bottom" rowspan="1" colspan="1">0</th><th align="right" valign="bottom" rowspan="1" colspan="1">1</th><th align="right" valign="bottom" rowspan="1" colspan="1">3</th></tr></thead><tbody><tr><td align="right" rowspan="1" colspan="1">1</td><td align="right" rowspan="1" colspan="1">357</td><td align="right" rowspan="1" colspan="1"/><td align="right" rowspan="1" colspan="1"/></tr><tr><td align="right" rowspan="1" colspan="1">2</td><td align="right" rowspan="1" colspan="1">159</td><td align="right" rowspan="1" colspan="1"/><td align="right" rowspan="1" colspan="1"/></tr><tr><td align="right" rowspan="1" colspan="1">3</td><td align="right" rowspan="1" colspan="1">111</td><td align="right" rowspan="1" colspan="1"/><td align="right" rowspan="1" colspan="1"/></tr><tr><td align="right" rowspan="1" colspan="1">4</td><td align="right" rowspan="1" colspan="1">89</td><td align="right" rowspan="1" colspan="1"/><td align="right" rowspan="1" colspan="1"/></tr><tr><td align="right" rowspan="1" colspan="1">5</td><td align="right" rowspan="1" colspan="1"/><td align="right" rowspan="1" colspan="1">67</td><td align="right" rowspan="1" colspan="1"/></tr><tr><td align="right" rowspan="1" colspan="1">6</td><td align="right" rowspan="1" colspan="1">59</td><td align="right" rowspan="1" colspan="1"/><td align="right" rowspan="1" colspan="1"/></tr><tr><td align="right" rowspan="1" colspan="1">7</td><td align="right" rowspan="1" colspan="1">48</td><td align="right" rowspan="1" colspan="1"/><td align="right" rowspan="1" colspan="1">3</td></tr></tbody></table></table-wrap>
<preformat>
Iteration 0:   log pseudolikelihood = &#x02212;706.60703
Iteration 1:   log pseudolikelihood = &#x02212;699.40805
Iteration 2:   log pseudolikelihood = &#x02212;699.36553
Iteration 3:   log pseudolikelihood = &#x02212;699.36553
</preformat>
<table-wrap id="T10" position="anchor" orientation="portrait"><table frame="below" rules="none"><tbody><tr><td align="left" colspan="3" rowspan="1">Generalized linear models</td><td align="right" rowspan="1" colspan="1"/><td align="left" colspan="3" rowspan="1">No. of obs = 670</td></tr><tr><td align="left" colspan="3" rowspan="1">Optimization : ML</td><td align="right" rowspan="1" colspan="1"/><td align="left" colspan="3" rowspan="1">Residual df = 666</td></tr><tr><td align="left" colspan="3" rowspan="1"/><td align="right" rowspan="1" colspan="1"/><td align="left" colspan="3" rowspan="1">Scale parameter = 1</td></tr><tr><td align="left" colspan="3" rowspan="1">Deviance = 1398.731061</td><td align="right" rowspan="1" colspan="1"/><td align="left" colspan="3" rowspan="1">(1/df) Deviance = 2.100197</td></tr><tr><td align="left" colspan="3" rowspan="1">Pearson = 1689.294056</td><td align="right" rowspan="1" colspan="1"/><td align="left" colspan="3" rowspan="1">(1/df) Pearson = 2.536478</td></tr><tr><td align="left" colspan="3" rowspan="1">Variance function: V(u) = u*(1&#x02212;u/1)</td><td align="right" rowspan="1" colspan="1"/><td align="left" colspan="3" rowspan="1">[Binomial]</td></tr><tr><td align="left" colspan="3" rowspan="1">Link function : g(u) = ln(u/(1&#x02212;u))</td><td align="right" rowspan="1" colspan="1"/><td align="left" colspan="3" rowspan="1">[Logit]</td></tr><tr><td align="left" colspan="3" rowspan="1"/><td align="right" rowspan="1" colspan="1"/><td align="left" colspan="3" rowspan="1">AIC = 2.099599</td></tr><tr><td align="left" colspan="3" rowspan="1">Log pseudolikelihood = &#x02212;699.3655307</td><td align="right" rowspan="1" colspan="1"/><td align="left" colspan="3" rowspan="1">BIC = &#x02212;2935.116</td></tr><tr><td align="right" colspan="7" rowspan="1">(Std. Err. adjusted for 205 clusters in idcode)</td></tr><tr><td align="right" colspan="7" valign="bottom" rowspan="1">
<hr/></td></tr><tr><td align="right" rowspan="1" colspan="1"/><td align="right" rowspan="1" colspan="1"/><td align="right" rowspan="1" colspan="1">Robust</td><td align="right" rowspan="1" colspan="1"/><td align="left" rowspan="1" colspan="1"/><td align="right" rowspan="1" colspan="1"/><td align="right" rowspan="1" colspan="1"/></tr><tr><td align="right" rowspan="1" colspan="1">xtrccipw_union</td><td align="right" rowspan="1" colspan="1">Coef.</td><td align="right" rowspan="1" colspan="1">Std. Err.</td><td align="right" rowspan="1" colspan="1">z</td><td align="left" rowspan="1" colspan="1">P&#x0003e;|z|</td><td align="right" colspan="2" rowspan="1">[95% Conf. Interval]</td></tr><tr><td align="right" colspan="7" valign="bottom" rowspan="1">
<hr/></td></tr><tr><td align="right" rowspan="1" colspan="1">age</td><td align="right" rowspan="1" colspan="1">&#x02212;.1464272</td><td align="right" rowspan="1" colspan="1">.0455808</td><td align="right" rowspan="1" colspan="1">&#x02212;3.21</td><td align="left" rowspan="1" colspan="1">0.001</td><td align="right" rowspan="1" colspan="1">&#x02212;.2357638</td><td align="right" rowspan="1" colspan="1">&#x02212;.0570906</td></tr><tr><td align="right" rowspan="1" colspan="1">ln_wage</td><td align="right" rowspan="1" colspan="1">1.26635</td><td align="right" rowspan="1" colspan="1">.3806582</td><td align="right" rowspan="1" colspan="1">3.33</td><td align="left" rowspan="1" colspan="1">0.001</td><td align="right" rowspan="1" colspan="1">.5202734</td><td align="right" rowspan="1" colspan="1">2.012426</td></tr><tr><td align="right" rowspan="1" colspan="1">birth_yr</td><td align="right" rowspan="1" colspan="1">&#x02212;.03907</td><td align="right" rowspan="1" colspan="1">.0794123</td><td align="right" rowspan="1" colspan="1">&#x02212;0.49</td><td align="left" rowspan="1" colspan="1">0.623</td><td align="right" rowspan="1" colspan="1">&#x02212;.1947152</td><td align="right" rowspan="1" colspan="1">.1165752</td></tr><tr><td align="right" rowspan="1" colspan="1">_cons</td><td align="right" rowspan="1" colspan="1">1.720208</td><td align="right" rowspan="1" colspan="1">4.46455</td><td align="right" rowspan="1" colspan="1">0.39</td><td align="left" rowspan="1" colspan="1">0.700</td><td align="right" rowspan="1" colspan="1">&#x02212;7.03015</td><td align="right" rowspan="1" colspan="1">10.47057</td></tr></tbody></table></table-wrap>Here is the output for the corresponding RCC-reduced MCAR model for comparison:
<preformat>
. use nlswork5_xtrccipw, clear
(NLS: Young women 14&#x02013;26 years of age in 1968. Example dataset for xtrccipw.)
. xtrccipw i.union, idvar(idcode) timevar(year) timeidxvar(yearidx)
&#x0003e; generate(ipw_mcarred) trtimevar(truncyear) linkfxn(probit)
&#x0003e; tdindepvars(ttl_exp) tiindepvars(i.collgrad) lagreduced(0)
&#x0003e; glmvars(age ln_wage birth_yr) glmfamily(binomial)
outcomevar = i.union
idvar = idcode
timevar = year
timeidxvar = yearidx
generate = ipw_mcarred
timeidxf = 1
timeidxl = 7
trtimevar = truncyear
linkfxn = probit
tdindepvars = ttl_exp
tiindepvars = i.collgrad
mcar =
lagreduced = 0
glmvars = age ln_wage birth_yr
glmfamily = binomial
glmlink =
</preformat>
<table-wrap id="T11" position="anchor" orientation="portrait"><table frame="hsides" rules="cols"><thead><tr><th align="right" rowspan="2" valign="top" colspan="1">interview<break/>year</th><th align="right" valign="top" rowspan="1" colspan="1">xtrccipw_ec</th></tr><tr><th align="right" valign="top" rowspan="1" colspan="1">0</th></tr><tr><th align="right" colspan="2" valign="bottom" rowspan="1">
<hr/></th></tr></thead><tbody><tr><td align="right" rowspan="1" colspan="1">1</td><td align="right" rowspan="1" colspan="1">357</td></tr><tr><td align="right" rowspan="1" colspan="1">2</td><td align="right" rowspan="1" colspan="1">159</td></tr><tr><td align="right" rowspan="1" colspan="1">3</td><td align="right" rowspan="1" colspan="1">111</td></tr><tr><td align="right" rowspan="1" colspan="1">4</td><td align="right" rowspan="1" colspan="1">89</td></tr><tr><td align="right" rowspan="1" colspan="1">5</td><td align="right" rowspan="1" colspan="1">67</td></tr><tr><td align="right" rowspan="1" colspan="1">6</td><td align="right" rowspan="1" colspan="1">59</td></tr><tr><td align="right" rowspan="1" colspan="1">7</td><td align="right" rowspan="1" colspan="1">51</td></tr></tbody></table></table-wrap>
<preformat>
Iteration 0:   log pseudolikelihood = &#x02212;768.5719
Iteration 1:   log pseudolikelihood = &#x02212;759.70025
Iteration 2:   log pseudolikelihood = &#x02212;759.6436
Iteration 3:   log pseudolikelihood = &#x02212;759.64359
</preformat>
<table-wrap id="T12" position="anchor" orientation="portrait"><table frame="below" rules="none"><tbody><tr><td align="left" colspan="3" rowspan="1">Generalized linear models</td><td align="right" rowspan="1" colspan="1"/><td align="left" colspan="3" rowspan="1">No. of obs = 670</td></tr><tr><td align="left" colspan="3" rowspan="1">Optimization : ML</td><td align="right" rowspan="1" colspan="1"/><td align="left" colspan="3" rowspan="1">Residual df = 666</td></tr><tr><td align="left" colspan="3" rowspan="1"/><td align="right" rowspan="1" colspan="1"/><td align="left" colspan="3" rowspan="1">Scale parameter = 1</td></tr><tr><td align="left" colspan="3" rowspan="1">Deviance = 1519.287182</td><td align="right" rowspan="1" colspan="1"/><td align="left" colspan="3" rowspan="1">(1/df) Deviance = 2.281212</td></tr><tr><td align="left" colspan="3" rowspan="1">Pearson = 1876.698513</td><td align="right" rowspan="1" colspan="1"/><td align="left" colspan="3" rowspan="1">(1/df) Pearson = 2.817866</td></tr><tr><td align="left" colspan="3" rowspan="1">Variance function: V(u) = u*(1&#x02212;u/1)</td><td align="right" rowspan="1" colspan="1"/><td align="left" colspan="3" rowspan="1">[Binomial]</td></tr><tr><td align="left" colspan="3" rowspan="1">Link function : g(u) = ln(u/(1&#x02212;u))</td><td align="right" rowspan="1" colspan="1"/><td align="left" colspan="3" rowspan="1">[Logit]</td></tr><tr><td align="left" colspan="3" rowspan="1"/><td align="right" rowspan="1" colspan="1"/><td align="left" colspan="3" rowspan="1">AIC = 2.279533</td></tr><tr><td align="left" colspan="3" rowspan="1">Log pseudolikelihood = &#x02212;759.6435911</td><td align="right" rowspan="1" colspan="1"/><td align="left" colspan="3" rowspan="1">BIC = &#x02212;2814.56</td></tr><tr><td align="right" colspan="7" rowspan="1">(Std. Err. adjusted for 205 clusters in idcode)</td></tr><tr><td align="right" colspan="7" valign="bottom" rowspan="1">
<hr/></td></tr><tr><td align="right" rowspan="1" colspan="1"/><td align="right" rowspan="1" colspan="1"/><td align="right" rowspan="1" colspan="1">Robust</td><td align="right" rowspan="1" colspan="1"/><td align="left" rowspan="1" colspan="1"/><td align="right" rowspan="1" colspan="1"/><td align="right" rowspan="1" colspan="1"/></tr><tr><td align="right" rowspan="1" colspan="1">xtrccipw_union</td><td align="right" rowspan="1" colspan="1">Coef.</td><td align="right" rowspan="1" colspan="1">Std. Err.</td><td align="right" rowspan="1" colspan="1">z</td><td align="left" rowspan="1" colspan="1">P&#x0003e;|z|</td><td align="right" colspan="2" rowspan="1">[95% Conf. Interval]</td></tr><tr><td align="right" colspan="7" valign="bottom" rowspan="1">
<hr/></td></tr><tr><td align="right" rowspan="1" colspan="1">age</td><td align="right" rowspan="1" colspan="1">&#x02212;.1507094</td><td align="right" rowspan="1" colspan="1">.0461782</td><td align="right" rowspan="1" colspan="1">&#x02212;3.26</td><td align="left" rowspan="1" colspan="1">0.001</td><td align="right" rowspan="1" colspan="1">&#x02212;.241217</td><td align="right" rowspan="1" colspan="1">&#x02212;.0602017</td></tr><tr><td align="right" rowspan="1" colspan="1">ln_wage</td><td align="right" rowspan="1" colspan="1">1.261449</td><td align="right" rowspan="1" colspan="1">.4020585</td><td align="right" rowspan="1" colspan="1">3.14</td><td align="left" rowspan="1" colspan="1">0.002</td><td align="right" rowspan="1" colspan="1">.473429</td><td align="right" rowspan="1" colspan="1">2.049469</td></tr><tr><td align="right" rowspan="1" colspan="1">birth_yr</td><td align="right" rowspan="1" colspan="1">&#x02212;.0309284</td><td align="right" rowspan="1" colspan="1">.0848459</td><td align="right" rowspan="1" colspan="1">&#x02212;0.36</td><td align="left" rowspan="1" colspan="1">0.715</td><td align="right" rowspan="1" colspan="1">&#x02212;.1972234</td><td align="right" rowspan="1" colspan="1">.1353666</td></tr><tr><td align="right" rowspan="1" colspan="1">_cons</td><td align="right" rowspan="1" colspan="1">1.476253</td><td align="right" rowspan="1" colspan="1">4.720117</td><td align="right" rowspan="1" colspan="1">0.31</td><td align="left" rowspan="1" colspan="1">0.754</td><td align="right" rowspan="1" colspan="1">&#x02212;7.775006</td><td align="right" rowspan="1" colspan="1">10.72751</td></tr></tbody></table></table-wrap></p></sec><sec id="S14"><title>5 Simulation study and PEP data analysis</title><p id="P49">In this section, we report results from a simulation study and reanalysis of the PEP analysis data from <xref rid="R12" ref-type="bibr">Kurland and Heagerty (2005)</xref>.</p><sec id="S15"><title>5.1 Simulation study</title><p id="P50">The data-generating specifications used to simulate 1,000 datasets with 1,000 individuals each were similar to those found in section 5 of <xref rid="R12" ref-type="bibr">Kurland and Heagerty (2005)</xref> and are summarized as follows. The outcome of interest was a binary variable representing ADL disability, denoted by <italic>Y<sub>ij</sub></italic> = 1 if individual <italic>i</italic> is disabled at time point <italic>j</italic> = 1, &#x02026;, 5, and <italic>Y<sub>ij</sub></italic> = 0 otherwise. The relevant covariates were sex<sub><italic>i</italic></sub> = 0 for women (and sex<sub><italic>i</italic></sub> = 1 otherwise), time<sub><italic>ij</italic></sub> = age<sub><italic>ij</italic></sub> &#x02212; 65 (where age<sub><italic>ij</italic></sub> = 65, 70, 75, 80, 85 years), and sex-time interaction. Let <bold><italic>&#x003b2;</italic></bold><sup>RCC</sup> = (<italic>&#x003b2;</italic><sub>0</sub>, <italic>&#x003b2;</italic><sub>1</sub>, <italic>&#x003b2;</italic><sub>2</sub>, <italic>&#x003b2;</italic><sub>3</sub>)&#x02032; denote the corresponding vector of coefficients. The binary outcome RCC model was specified as
<disp-formula id="FD4"><mml:math id="M18" display="block" overflow="scroll"><mml:mtext>logit&#x000a0;</mml:mtext><mml:mo stretchy="false">{</mml:mo><mml:mi>E</mml:mi><mml:mo stretchy="false">(</mml:mo><mml:msub><mml:mi>Y</mml:mi><mml:mtext mathvariant="italic">ij</mml:mtext></mml:msub><mml:mo stretchy="false">|</mml:mo><mml:msub><mml:mi>C</mml:mi><mml:mtext mathvariant="italic">ij</mml:mtext></mml:msub><mml:mo>=</mml:mo><mml:mn>1</mml:mn><mml:mo stretchy="false">)</mml:mo><mml:mo stretchy="false">}</mml:mo><mml:mo>=</mml:mo><mml:msub><mml:mi>&#x003b2;</mml:mi><mml:mn>0</mml:mn></mml:msub><mml:mo>+</mml:mo><mml:msub><mml:mi>&#x003b2;</mml:mi><mml:mn>1</mml:mn></mml:msub><mml:mo>&#x000d7;</mml:mo><mml:msub><mml:mtext>sex</mml:mtext><mml:mi>i</mml:mi></mml:msub><mml:mo>+</mml:mo><mml:msub><mml:mi>&#x003b2;</mml:mi><mml:mn>2</mml:mn></mml:msub><mml:mo>&#x000d7;</mml:mo><mml:msub><mml:mtext>time</mml:mtext><mml:mtext mathvariant="italic">ij</mml:mtext></mml:msub><mml:mo>+</mml:mo><mml:msub><mml:mi>&#x003b2;</mml:mi><mml:mn>3</mml:mn></mml:msub><mml:mo>&#x000d7;</mml:mo><mml:msub><mml:mtext>sex</mml:mtext><mml:mi>i</mml:mi></mml:msub><mml:mo>&#x000d7;</mml:mo><mml:msub><mml:mtext>time</mml:mtext><mml:mtext mathvariant="italic">ij</mml:mtext></mml:msub></mml:math></disp-formula>with <bold><italic>&#x003b2;</italic></bold><sup>RCC</sup> = (&#x02212;2.19, 0.5, 0.1, &#x02212;0.025)&#x02032;. The binary outcome was defined as 
<inline-formula><mml:math id="M19" overflow="scroll"><mml:msub><mml:mi>Y</mml:mi><mml:mtext mathvariant="italic">ij</mml:mtext></mml:msub><mml:mo>=</mml:mo><mml:mi>I</mml:mi><mml:mo stretchy="false">(</mml:mo><mml:msubsup><mml:mi>Y</mml:mi><mml:mtext mathvariant="italic">ij</mml:mtext><mml:mo>&#x02217;</mml:mo></mml:msubsup><mml:mo>&#x0003e;</mml:mo><mml:mn>0</mml:mn><mml:mo stretchy="false">)</mml:mo></mml:math></inline-formula>, where 
<inline-formula><mml:math id="M20" overflow="scroll"><mml:msubsup><mml:mi>Y</mml:mi><mml:mtext mathvariant="italic">ij</mml:mtext><mml:mo>&#x02217;</mml:mo></mml:msubsup></mml:math></inline-formula> was a normally distributed variable with mean 
<inline-formula><mml:math id="M21" overflow="scroll"><mml:msubsup><mml:mi>&#x003bc;</mml:mi><mml:mtext mathvariant="italic">ij</mml:mtext><mml:mi>U</mml:mi></mml:msubsup></mml:math></inline-formula> and standard deviation <italic>&#x003c3;</italic><sub><italic>Y</italic>*</sub> = 0.15. The correlation for the vector of outcomes 
<inline-formula><mml:math id="M22" overflow="scroll"><mml:mo stretchy="false">(</mml:mo><mml:msubsup><mml:mi>Y</mml:mi><mml:mrow><mml:mi>i</mml:mi><mml:mn>1</mml:mn></mml:mrow><mml:mo>&#x02217;</mml:mo></mml:msubsup><mml:mo>,</mml:mo><mml:mo>&#x02026;</mml:mo><mml:mo>,</mml:mo><mml:msubsup><mml:mi>Y</mml:mi><mml:mrow><mml:mi>i</mml:mi><mml:mn>5</mml:mn></mml:mrow><mml:mo>&#x02217;</mml:mo></mml:msubsup><mml:mo stretchy="false">)</mml:mo></mml:math></inline-formula> was order-1 autoregressive (AR1). Nontruncation was defined as <italic>C<sub>ij</sub></italic> = <italic>I</italic> (&#x1d4ae;<sub><italic>i</italic></sub> &#x0003e; age<sub><italic>ij</italic></sub>), where &#x1d4ae;<sub><italic>i</italic></sub> represented time of death, a normally distributed variable with mean 85 for women and 80 for men and standard deviation <italic>&#x003c3;<sub>S</sub></italic> = 5. The correlation among 
<inline-formula><mml:math id="M23" overflow="scroll"><mml:msubsup><mml:mi>Y</mml:mi><mml:mtext mathvariant="italic">ij</mml:mtext><mml:mo>&#x02217;</mml:mo></mml:msubsup></mml:math></inline-formula> was set as 0.7, and the covariance of 
<inline-formula><mml:math id="M24" overflow="scroll"><mml:msubsup><mml:mi>Y</mml:mi><mml:mtext mathvariant="italic">ij</mml:mtext><mml:mo>&#x02217;</mml:mo></mml:msubsup></mml:math></inline-formula> and &#x1d4ae;<sub><italic>i</italic></sub> was set as &#x02212;0.4 for women and &#x02212;0.3 for men. By using the identity
<disp-formula id="FD5"><mml:math id="M25" display="block" overflow="scroll"><mml:mi>E</mml:mi><mml:mo stretchy="false">(</mml:mo><mml:msub><mml:mi>Y</mml:mi><mml:mtext mathvariant="italic">ij</mml:mtext></mml:msub><mml:mo stretchy="false">|</mml:mo><mml:msub><mml:mi>C</mml:mi><mml:mtext mathvariant="italic">ij</mml:mtext></mml:msub><mml:mo>=</mml:mo><mml:mn>1</mml:mn><mml:mo stretchy="false">)</mml:mo><mml:mo>=</mml:mo><mml:mtext>Pr&#x000a0;</mml:mtext><mml:mo stretchy="false">(</mml:mo><mml:msubsup><mml:mi>Y</mml:mi><mml:mtext mathvariant="italic">ij</mml:mtext><mml:mo>&#x02217;</mml:mo></mml:msubsup><mml:mo>&#x0003e;</mml:mo><mml:mn>0</mml:mn><mml:mo stretchy="false">|</mml:mo><mml:msub><mml:mi>&#x1d4ae;</mml:mi><mml:mi>i</mml:mi></mml:msub><mml:mo>&#x0003e;</mml:mo><mml:msub><mml:mtext>age</mml:mtext><mml:mtext mathvariant="italic">ij</mml:mtext></mml:msub><mml:mo stretchy="false">)</mml:mo><mml:mo>=</mml:mo><mml:mfrac><mml:mrow><mml:mtext>Pr&#x000a0;</mml:mtext><mml:mo stretchy="false">(</mml:mo><mml:msubsup><mml:mi>Y</mml:mi><mml:mtext mathvariant="italic">ij</mml:mtext><mml:mo>&#x02217;</mml:mo></mml:msubsup><mml:mo>&#x0003e;</mml:mo><mml:mn>0</mml:mn><mml:mo>,</mml:mo><mml:msub><mml:mi>&#x1d4ae;</mml:mi><mml:mi>i</mml:mi></mml:msub><mml:mo>&#x0003e;</mml:mo><mml:msub><mml:mtext>age</mml:mtext><mml:mtext mathvariant="italic">ij</mml:mtext></mml:msub><mml:mo stretchy="false">)</mml:mo></mml:mrow><mml:mrow><mml:mtext>Pr&#x000a0;</mml:mtext><mml:mo stretchy="false">(</mml:mo><mml:msub><mml:mi>&#x1d4ae;</mml:mi><mml:mi>i</mml:mi></mml:msub><mml:mo>&#x0003e;</mml:mo><mml:msub><mml:mtext>age</mml:mtext><mml:mtext mathvariant="italic">ij</mml:mtext></mml:msub><mml:mo stretchy="false">)</mml:mo></mml:mrow></mml:mfrac></mml:math></disp-formula>values for 
<inline-formula><mml:math id="M26" overflow="scroll"><mml:msubsup><mml:mi>&#x003bc;</mml:mi><mml:mtext mathvariant="italic">ij</mml:mtext><mml:mi>U</mml:mi></mml:msubsup></mml:math></inline-formula> were calculated via bisection with an arbitrary precision tolerance of 0.0001. All 
<inline-formula><mml:math id="M27" overflow="scroll"><mml:msubsup><mml:mi>&#x003bc;</mml:mi><mml:mtext mathvariant="italic">ij</mml:mtext><mml:mi>U</mml:mi></mml:msubsup></mml:math></inline-formula> values were calculated using the 
<monospace>pmvnorm()</monospace> function of the 
<monospace>mvtnorm</monospace> package in R. Dropout was generated by specifying
<disp-formula id="FD6"><mml:math id="M28" display="block" overflow="scroll"><mml:mtext>logit&#x000a0;</mml:mtext><mml:mo stretchy="false">(</mml:mo><mml:msub><mml:mi>&#x003bb;</mml:mi><mml:mtext mathvariant="italic">ik</mml:mtext></mml:msub><mml:mo stretchy="false">)</mml:mo><mml:mo>=</mml:mo><mml:msub><mml:mi>&#x003d5;</mml:mi><mml:mn>0</mml:mn></mml:msub><mml:mo>+</mml:mo><mml:msub><mml:mi>&#x003d5;</mml:mi><mml:mn>1</mml:mn></mml:msub><mml:mo stretchy="false">(</mml:mo><mml:msub><mml:mi>&#x1d4ae;</mml:mi><mml:mi>i</mml:mi></mml:msub><mml:mo>&#x02212;</mml:mo><mml:msub><mml:mtext>age</mml:mtext><mml:mtext mathvariant="italic">ij</mml:mtext></mml:msub><mml:mo stretchy="false">)</mml:mo></mml:math></disp-formula>where <italic>&#x003d5;</italic><sub>0</sub> = &#x02212;0.5 and <italic>&#x003d5;</italic><sub>1</sub> = 0.15. Truncation or dropout was not allowed at the first time point.</p><p id="P51">The following three estimators mirror those of <xref rid="R12" ref-type="bibr">Kurland and Heagerty (2005)</xref> and were used to estimate the mean binary outcome. (The marginalized transition model was not included because its technical specifications were beyond the scope of this article, and its inclusion was not necessary to demonstrate the simulation-based performance of RCC.)
<list list-type="order" id="L1"><list-item><p id="P52">IEE: GEE with independent working correlation. This is identical to the <xref rid="R12" ref-type="bibr">Kurland and Heagerty (2005)</xref> independence estimating equations (IEE) model (that is, model with parameters estimated using IEEE).</p></list-item><list-item><p id="P53">GEE-AR1: GEE with AR1 working correlation. This is similar to the <xref rid="R12" ref-type="bibr">Kurland and Heagerty (2005)</xref> inverse probability of censoring weighted (IPCW)-GEE model (that is, model with parameters estimated using IPCW-GEE) but without IPWs. (The original IPCW GEE model was not reproduced because to date, no Stata commands allow for GEE estimation with time-varying weights.)</p></list-item><list-item><p id="P54">RCC: IEE with correctly specified IPWs. This is identical to the <xref rid="R12" ref-type="bibr">Kurland and Heagerty (2005)</xref> IPCW-IEE model (that is, model with parameters estimated using IPCW-IEEE).</p></list-item></list>The RCC estimator was the only estimator expected to be consistent for the <bold><italic>&#x003b2;</italic></bold><sup>RCC</sup> coefficients. For each <italic>&#x003b2;<sub>p</sub></italic> where <italic>p</italic> = 0, &#x02026;, 3, the empirical relative bias was calculated by taking the average of the empirical bias over all datasets as a percentage of <italic>&#x003b2;<sub>p</sub></italic>, and the coverage probability was calculated as the percentage of all confidence intervals that contained <italic>&#x003b2;<sub>p</sub></italic>.</p><p id="P55">We generated simulated datasets in Stata 14 using the parameter values above and analyzed them as follows. RCC IPWs were estimated using the following code:
<preformat>
. xtrccipw i.Yij, idvar(idvarname) timevar(ageij) timeidxvar(timeidx)
&#x0003e; generate(ipw_sims) trtimevar(trunctime) linkfxn(logit) tdindepvars(Siminusageij)
&#x0003e; mcar
</preformat>
<monospace>i.Yij</monospace> represents <italic>Y<sub>ij</sub></italic>, 
<monospace>ageij</monospace> represents age<sub><italic>ij</italic></sub>, and 
<monospace>Siminusageij</monospace> represents &#x1d4ae;<sub><italic>i</italic></sub> &#x02212; age<sub><italic>ij</italic></sub>. After specifying the individual-identifier and measurement-time variables using 
<monospace>xtset idvarname timeij</monospace>, where 
<monospace>timeij</monospace> represents time<sub><italic>ij</italic></sub>, we implemented the IEE estimator via the following code:
<preformat>
. xtgee xtrccipw_Yij i.sexi timeij sexitimeij, family(binomial) vce(robust)
&#x0003e; corr(independent)
</preformat>
<monospace>xtrccipw_Yij</monospace> represents the outcome variable used by 
<monospace>xtrccipw</monospace>, 
<monospace>i.sexi</monospace> represents sex<sub><italic>i</italic></sub>, and 
<monospace>sexitimeij</monospace> represents sex<sub><italic>i</italic></sub> &#x000d7; time<sub><italic>ij</italic></sub>. The code used to implement the GEE-AR1 estimator was identical, except that the AR1 working correlation was specified using 
<monospace>corr(ar 1)</monospace>. The RCC estimator was implemented with the following code:
<preformat>
. glm xtrccipw_Yij i.sexi timeij sexitimeij [pweight=ipw_sims], family(binomial)
&#x0003e; vce(cluster idvarname)
</preformat></p><p id="P56">The simulation results are listed in <xref ref-type="table" rid="T2">table 2</xref>. RCC produced the smallest empirical relative bias and was the only approach that exhibited coverage close to or greater than the 95% nominal level for all <italic>&#x003b2;<sub>p</sub></italic>. These results qualitatively agree with the corresponding empirical relative bias findings in table 4 of <xref rid="R12" ref-type="bibr">Kurland and Heagerty (2005)</xref>.</p></sec><sec id="S16"><title>5.2 PEP data analysis</title><p id="P57">We now reanalyze the <xref rid="R12" ref-type="bibr">Kurland and Heagerty (2005)</xref> analysis data from the PEP study. Few individuals dropped out (<italic>n</italic> = 17, 2.3%), and only 62 (8.2%) died in the first two years of the study. <xref rid="R12" ref-type="bibr">Kurland and Heagerty (2005)</xref> estimated the association of ADL disability with ADL-disability risk group (that is, risk levels low, medium, and high), month, month2, and the interaction between month and risk group. Their dropout model included all of these covariates in addition to sex, ADL-disability status at the previous month to reflect the MAR assumption, and a baseline depression indicator.</p><p id="P58">To analyze the PEP data, we called the 
<monospace>xtrccipw</monospace> command as follows, with the relevant output displayed. The variables were study ID (
<monospace>studyid</monospace>), month (
<monospace>month</monospace>), month index (
<monospace>monthidx</monospace>), ADL disability (
<monospace>adldis</monospace> = 
<monospace>1</monospace> if disabled; 
<monospace>0</monospace> otherwise), risk group (
<monospace>rgamed</monospace> = 
<monospace>0</monospace>, 
<monospace>rgahigh</monospace> = 
<monospace>0</monospace> for low; 
<monospace>rgamed</monospace> = 
<monospace>1</monospace>, 
<monospace>rgahigh</monospace> = 
<monospace>0</monospace> for medium; and 
<monospace>rgamed</monospace> = 
<monospace>0</monospace>, 
<monospace>rgahigh</monospace> = 
<monospace>1</monospace> for high), month<sup>2</sup> (
<monospace>monthsq</monospace>), medium-risk interaction with month (
<monospace>rgamedmonth</monospace> = 
<monospace>rgamed</monospace> &#x000d7; 
<monospace>month</monospace>), high-risk interaction with month (
<monospace>rgahighmonth</monospace> = 
<monospace>rgahigh</monospace> &#x000d7; 
<monospace>month</monospace>), and ADL disability status at the previous month (
<monospace>lagreduced</monospace> = 
<monospace>1</monospace>). The dropout mechanism was modeled using a logit link.
<preformat>
. xtrccipw i.adldis, idvar(studyid) timevar(month) timeidxvar(monthidx)
&#x0003e; generate(ipw_pep) trtimevar(deathmo) linkfxn(logit) tdindepvars(month monthsq
&#x0003e; rgamedmonth rgahighmonth) tiindepvars(i.rgamed i.rgahigh i.sex i.depresbl)
&#x0003e; lagreduced(1) glmvars(month monthsq rgamedmonth rgahighmonth i.rgamed i.rgahigh)
&#x0003e; glmfam(binomial)
outcomevar = i.adldis
idvar = studyid
timevar = month
timeidxvar = monthidx
generate = ipw_pep
timeidxf = 1
timeidxl = 24
trtimevar = deathmo
linkfxn = logit
tdindepvars = month monthsq rgamedmonth rgahighmonth
tiindepvars = i.rgamed i.rgahigh i.sex i.depresbl
mcar =
lagreduced = 1
glmvars = month monthsq rgamedmonth rgahighmonth i.rgamed i.rgahigh
glmfamily = binomial
glmlink =
</preformat>
<table-wrap id="T13" position="anchor" orientation="portrait"><table frame="hsides" rules="groups"><thead><tr><th align="right" rowspan="2" valign="bottom" colspan="1">monthidx</th><th align="right" colspan="2" valign="top" rowspan="1">xtrccipw_ec</th></tr><tr><th align="right" valign="top" rowspan="1" colspan="1">0</th><th align="right" valign="top" rowspan="1" colspan="1">1</th></tr></thead><tbody><tr><td align="right" rowspan="1" colspan="1">1</td><td align="right" rowspan="1" colspan="1"/><td align="right" rowspan="1" colspan="1">752</td></tr><tr><td align="right" rowspan="1" colspan="1">2</td><td align="right" rowspan="1" colspan="1">750</td><td align="right" rowspan="1" colspan="1"/></tr><tr><td align="right" rowspan="1" colspan="1">3</td><td align="right" rowspan="1" colspan="1">748</td><td align="right" rowspan="1" colspan="1"/></tr><tr><td align="right" rowspan="1" colspan="1">4</td><td align="right" rowspan="1" colspan="1">743</td><td align="right" rowspan="1" colspan="1"/></tr><tr><td align="right" rowspan="1" colspan="1">5</td><td align="right" rowspan="1" colspan="1">742</td><td align="right" rowspan="1" colspan="1"/></tr><tr><td align="right" rowspan="1" colspan="1">6</td><td align="right" rowspan="1" colspan="1">740</td><td align="right" rowspan="1" colspan="1"/></tr><tr><td align="right" rowspan="1" colspan="1">7</td><td align="right" rowspan="1" colspan="1">735</td><td align="right" rowspan="1" colspan="1"/></tr><tr><td align="right" rowspan="1" colspan="1">8</td><td align="right" rowspan="1" colspan="1">731</td><td align="right" rowspan="1" colspan="1"/></tr><tr><td align="right" rowspan="1" colspan="1">9</td><td align="right" rowspan="1" colspan="1">730</td><td align="right" rowspan="1" colspan="1"/></tr><tr><td align="right" rowspan="1" colspan="1">10</td><td align="right" rowspan="1" colspan="1">729</td><td align="right" rowspan="1" colspan="1"/></tr><tr><td align="right" rowspan="1" colspan="1">11</td><td align="right" rowspan="1" colspan="1">727</td><td align="right" rowspan="1" colspan="1"/></tr><tr><td align="right" rowspan="1" colspan="1">12</td><td align="right" rowspan="1" colspan="1">721</td><td align="right" rowspan="1" colspan="1"/></tr><tr><td align="right" rowspan="1" colspan="1">13</td><td align="right" rowspan="1" colspan="1">715</td><td align="right" rowspan="1" colspan="1"/></tr><tr><td align="right" rowspan="1" colspan="1">14</td><td align="right" rowspan="1" colspan="1">712</td><td align="right" rowspan="1" colspan="1"/></tr><tr><td align="right" rowspan="1" colspan="1">15</td><td align="right" rowspan="1" colspan="1">710</td><td align="right" rowspan="1" colspan="1"/></tr><tr><td align="right" rowspan="1" colspan="1">16</td><td align="right" rowspan="1" colspan="1">706</td><td align="right" rowspan="1" colspan="1"/></tr><tr><td align="right" rowspan="1" colspan="1">17</td><td align="right" rowspan="1" colspan="1">701</td><td align="right" rowspan="1" colspan="1"/></tr><tr><td align="right" rowspan="1" colspan="1">18</td><td align="right" rowspan="1" colspan="1">700</td><td align="right" rowspan="1" colspan="1"/></tr><tr><td align="right" rowspan="1" colspan="1">19</td><td align="right" rowspan="1" colspan="1">696</td><td align="right" rowspan="1" colspan="1"/></tr><tr><td align="right" rowspan="1" colspan="1">20</td><td align="right" rowspan="1" colspan="1">690</td><td align="right" rowspan="1" colspan="1"/></tr><tr><td align="right" rowspan="1" colspan="1">21</td><td align="right" rowspan="1" colspan="1">686</td><td align="right" rowspan="1" colspan="1"/></tr><tr><td align="right" rowspan="1" colspan="1">22</td><td align="right" rowspan="1" colspan="1">681</td><td align="right" rowspan="1" colspan="1"/></tr><tr><td align="right" rowspan="1" colspan="1">23</td><td align="right" rowspan="1" colspan="1">677</td><td align="right" rowspan="1" colspan="1"/></tr><tr><td align="right" rowspan="1" colspan="1">24</td><td align="right" rowspan="1" colspan="1">674</td><td align="right" rowspan="1" colspan="1"/></tr></tbody></table></table-wrap>
<preformat>
Iteration 0: log pseudolikelihood = &#x02212;4805.9074
Iteration 1: log pseudolikelihood = &#x02212;4456.9226
Iteration 2: log pseudolikelihood = &#x02212;4448.8392
Iteration 3: log pseudolikelihood = &#x02212;4448.7424
Iteration 4: log pseudolikelihood = &#x02212;4448.7424
</preformat>
<table-wrap id="T14" position="anchor" orientation="portrait"><table frame="below" rules="none"><tbody><tr><td align="left" colspan="3" rowspan="1">Generalized linear models</td><td align="right" rowspan="1" colspan="1"/><td align="left" colspan="3" rowspan="1">No. of obs = 17,177</td></tr><tr><td align="left" colspan="3" rowspan="1">Optimization : ML</td><td align="right" rowspan="1" colspan="1"/><td align="left" colspan="3" rowspan="1">Residual df = 17,170</td></tr><tr><td align="left" colspan="3" rowspan="1"/><td align="right" rowspan="1" colspan="1"/><td align="left" colspan="3" rowspan="1">Scale parameter = 1</td></tr><tr><td align="left" colspan="3" rowspan="1">Deviance = 8897.484773</td><td align="right" rowspan="1" colspan="1"/><td align="left" colspan="3" rowspan="1">(1/df) Deviance = .5181995</td></tr><tr><td align="left" colspan="3" rowspan="1">Pearson = 17402.11245</td><td align="right" rowspan="1" colspan="1"/><td align="left" colspan="3" rowspan="1">(1/df) Pearson = 1.013518</td></tr><tr><td align="left" colspan="3" rowspan="1">Variance function: V(u) = u*(1&#x02212;u/1)</td><td align="right" rowspan="1" colspan="1"/><td align="left" colspan="3" rowspan="1">[Binomial]</td></tr><tr><td align="left" colspan="3" rowspan="1">Link function : g(u) = ln(u/(1&#x02212;u))</td><td align="right" rowspan="1" colspan="1"/><td align="left" colspan="3" rowspan="1">[Logit]</td></tr><tr><td align="left" colspan="3" rowspan="1"/><td align="right" rowspan="1" colspan="1"/><td align="left" colspan="3" rowspan="1">AIC = .5188033</td></tr><tr><td align="left" colspan="3" rowspan="1">Log pseudolikelihood = &#x02212;4448.742386</td><td align="right" rowspan="1" colspan="1"/><td align="left" colspan="3" rowspan="1">BIC = &#x02212;158532.8</td></tr><tr><td align="right" rowspan="1" colspan="1"/><td align="right" rowspan="1" colspan="1"/><td align="right" colspan="5" rowspan="1">(Std. Err. adjusted for 752 clusters in studyid)</td></tr><tr><td align="right" colspan="7" valign="bottom" rowspan="1">
<hr/></td></tr><tr><td align="right" rowspan="1" colspan="1"/><td align="right" rowspan="1" colspan="1"/><td align="center" rowspan="1" colspan="1">Robust</td><td align="right" rowspan="1" colspan="1"/><td align="center" rowspan="1" colspan="1"/><td align="right" rowspan="1" colspan="1"/><td align="right" rowspan="1" colspan="1"/></tr><tr><td align="right" rowspan="1" colspan="1">xtrccipw_adldis</td><td align="right" rowspan="1" colspan="1">Coef.</td><td align="center" rowspan="1" colspan="1">Std. Err.</td><td align="right" rowspan="1" colspan="1">z</td><td align="center" rowspan="1" colspan="1">P&#x0003e; |z|</td><td align="center" colspan="2" rowspan="1">[95% Conf. Interval]</td></tr><tr><td align="right" colspan="7" valign="bottom" rowspan="1">
<hr/></td></tr><tr><td align="right" rowspan="1" colspan="1">month</td><td align="right" rowspan="1" colspan="1">.042531</td><td align="center" rowspan="1" colspan="1">.0136743</td><td align="right" rowspan="1" colspan="1">3.11</td><td align="center" rowspan="1" colspan="1">0.002</td><td align="right" rowspan="1" colspan="1">.0157298</td><td align="right" rowspan="1" colspan="1">.0693322</td></tr><tr><td align="right" rowspan="1" colspan="1">monthsq</td><td align="right" rowspan="1" colspan="1">&#x02212;.0023904</td><td align="center" rowspan="1" colspan="1">.0007797</td><td align="right" rowspan="1" colspan="1">&#x02212;3.07</td><td align="center" rowspan="1" colspan="1">0.002</td><td align="right" rowspan="1" colspan="1">&#x02212;.0039185</td><td align="right" rowspan="1" colspan="1">&#x02212;.0008622</td></tr><tr><td align="right" rowspan="1" colspan="1">rgamedmonth</td><td align="right" rowspan="1" colspan="1">.0007953</td><td align="center" rowspan="1" colspan="1">.0159911</td><td align="right" rowspan="1" colspan="1">0.05</td><td align="center" rowspan="1" colspan="1">0.960</td><td align="right" rowspan="1" colspan="1">&#x02212;.0305466</td><td align="right" rowspan="1" colspan="1">.0321372</td></tr><tr><td align="right" rowspan="1" colspan="1">rgahighmonth</td><td align="right" rowspan="1" colspan="1">.0239548</td><td align="center" rowspan="1" colspan="1">.0186385</td><td align="right" rowspan="1" colspan="1">1.29</td><td align="center" rowspan="1" colspan="1">0.199</td><td align="right" rowspan="1" colspan="1">&#x02212;.012576</td><td align="right" rowspan="1" colspan="1">.0604855</td></tr><tr><td align="right" rowspan="1" colspan="1">1.rgamed</td><td align="right" rowspan="1" colspan="1">1.869464</td><td align="center" rowspan="1" colspan="1">.2275534</td><td align="right" rowspan="1" colspan="1">8.22</td><td align="center" rowspan="1" colspan="1">0.000</td><td align="right" rowspan="1" colspan="1">1.423468</td><td align="right" rowspan="1" colspan="1">2.31546</td></tr><tr><td align="right" rowspan="1" colspan="1">1.rgahigh</td><td align="right" rowspan="1" colspan="1">2.186206</td><td align="center" rowspan="1" colspan="1">.2463283</td><td align="right" rowspan="1" colspan="1">8.88</td><td align="center" rowspan="1" colspan="1">0.000</td><td align="right" rowspan="1" colspan="1">1.703412</td><td align="right" rowspan="1" colspan="1">2.669001</td></tr><tr><td align="right" rowspan="1" colspan="1">_cons</td><td align="right" rowspan="1" colspan="1">&#x02212;3.532125</td><td align="center" rowspan="1" colspan="1">.1850643</td><td align="right" rowspan="1" colspan="1">&#x02212;19.09</td><td align="center" rowspan="1" colspan="1">0.000</td><td align="right" rowspan="1" colspan="1">&#x02212;3.894844</td><td align="right" rowspan="1" colspan="1">&#x02212;3.169405</td></tr></tbody></table></table-wrap></p><p id="P59">These estimates were used to produce <xref ref-type="fig" rid="F1">figure 1</xref>. The predicted trajectories match the fitted curves for the IPCW-IEE estimator in figure 3 of <xref rid="R12" ref-type="bibr">Kurland and Heagerty (2005)</xref>. The fitted odds ratio comparing odds of disability in the high-risk group with that of the low-risk group at the last time point is 8.90, while <xref rid="R12" ref-type="bibr">Kurland and Heagerty (2005)</xref> estimated this odds ratio as 8.95. This minor difference likely results from 752 individuals in the data we analyzed (provided by Professor Kurland) compared with 754 individuals used by <xref rid="R12" ref-type="bibr">Kurland and Heagerty (2005)</xref>.</p></sec></sec><sec id="S17"><title>6 Discussion</title><p id="P60">In this article, we introduced the 
<monospace>xtrccipw</monospace> command to estimate the IPWs used to conduct WEE regression and, in particular, RCC. The assumed dropout-probability mechanism could be specified using either a logit or probit link function. We noted asymptotic properties of the subsequent 
<monospace>glm</monospace> mean and empirical sandwich variance estimates and demonstrated 
<monospace>xtrccipw</monospace> using an example with binary outcomes. Finally, we used 
<monospace>xtrccipw</monospace> to conduct a simulation study similar to that of <xref rid="R12" ref-type="bibr">Kurland and Heagerty (2005)</xref> and to reanalyze their original study findings.</p><p id="P61">The 
<monospace>xtrccipw</monospace> command does have some limitations. The command can estimate IPWs only if missingness is monotonic, while many studies suffer from nonmonotonic (that is, arbitrary or intermittent) missingness. To use 
<monospace>xtrccipw</monospace>, one may construct an &#x0201c;artificial&#x0201d; dropout indicator that treats the first instance of missingness as dropout, discarding any subsequent nonmissing outcomes (<xref rid="R20" ref-type="bibr">Robins, Rotnitzky, and Zhao 1995</xref>). One can also impute arbitrarily missing outcomes up to the last nonmissing outcome, as done in <xref rid="R12" ref-type="bibr">Kurland and Heagerty (2005)</xref>; however, valid subsequent inferences would need to account for imputation.</p><p id="P62">The RCC method is appropriate when one wishes to draw inference about a target population or real-world population that is itself subject to truncation and when one is interested only in the subset of continuing outcomes in the target population. For example, the PEP study investigators were interested only in the target population of living individuals. The 
<monospace>xtrccipw</monospace> command gives the user readily available software to run a WEE or RCC analysis or to simply calculate the relevant IPWs for longitudinal outcomes.</p></sec></body><back><ack id="S18"><p id="P63">This work was supported in part by grants SIP 13-01 U48-CCU409660-09, SIP 26-04 U48-DP000059-01, and SIP 22-09 U48-DP001944-01 from the Prevention Research Centers Special Interest Project of the U.S. Centers for Disease Control and Prevention; grant P30-AI50410 from the University of North Carolina Center for AIDS Research; grants DHHS/NIH/FIC 2-D43 Tw01039-06 and R24 Tw00798 of the American Recovery and Reinvestment Act from the National Institutes of Health Fogarty AIDS International Training and Research Program; grant OPP53107 from the Bill and Melinda Gates Foundation; grant R24 HD050924 from the Carolina Population Center; grant R01-AI029168; the U.S. National Institute of Allergy and Infectious Diseases grant R01-AI085073; and the National Institute of Environmental Health Sciences grant R01ES020619. The content of this article is solely the responsibility of the authors and does not necessarily represent the official views of Centers for Disease Control and Prevention, University of North Carolina, National Institutes of Health, Bill and Melinda Gates Foundation, Carolina Population Center, the National Institute of Allergy and Infectious Diseases, or the National Institute of Environmental Health Sciences. The authors would like to thank Dr. Brenda Kurland for access to the data from the PEP study and for her help and guidance in working with the datasets.</p></ack><ref-list><ref id="R1"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Basu</surname><given-names>A</given-names></name><name><surname>Manning</surname><given-names>WG</given-names></name></person-group><year>2010</year><article-title>Estimating lifetime or episode-of-illness costs under censoring</article-title><source>Health Economics</source><volume>19</volume><fpage>1010</fpage><lpage>1028</lpage><pub-id pub-id-type="pmid">20665908</pub-id></element-citation></ref><ref id="R2"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Billingham</surname><given-names>LJ</given-names></name><name><surname>Abrams</surname><given-names>KR</given-names></name></person-group><year>2002</year><article-title>Simultaneous analysis of quality of life and survival data</article-title><source>Statistical Methods in Medical Research</source><volume>11</volume><fpage>25</fpage><lpage>48</lpage><pub-id pub-id-type="pmid">11923992</pub-id></element-citation></ref><ref id="R3"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>le Cessie</surname><given-names>S</given-names></name><name><surname>de Vries</surname><given-names>EGE</given-names></name><name><surname>Buijs</surname><given-names>C</given-names></name><name><surname>Post</surname><given-names>WJ</given-names></name></person-group><year>2009</year><article-title>Analyzing longitudinal data with patients in different disease states during follow-up and death as final state</article-title><source>Statistics in Medicine</source><volume>28</volume><fpage>3829</fpage><lpage>3843</lpage><pub-id pub-id-type="pmid">19876950</pub-id></element-citation></ref><ref id="R4"><element-citation publication-type="book"><person-group person-group-type="author"><name><surname>Diggle</surname><given-names>PJ</given-names></name><name><surname>Heagerty</surname><given-names>P</given-names></name><name><surname>Liang</surname><given-names>K-Y</given-names></name><name><surname>Zeger</surname><given-names>SL</given-names></name></person-group><year>2002</year><source>Analysis of Longitudinal Data</source><edition>2</edition><publisher-loc>Oxford</publisher-loc><publisher-name>Oxford University Press</publisher-name></element-citation></ref><ref id="R5"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Dufouil</surname><given-names>C</given-names></name><name><surname>Brayne</surname><given-names>C</given-names></name><name><surname>Clayton</surname><given-names>D</given-names></name></person-group><year>2004</year><article-title>Analysis of longitudinal studies with death and drop-out: A case study</article-title><source>Statistics in Medicine</source><volume>23</volume><fpage>2215</fpage><lpage>2226</lpage><pub-id pub-id-type="pmid">15236426</pub-id></element-citation></ref><ref id="R6"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Flax</surname><given-names>VL</given-names></name><name><surname>Bentley</surname><given-names>ME</given-names></name><name><surname>Chasela</surname><given-names>CS</given-names></name><name><surname>Kayira</surname><given-names>D</given-names></name><name><surname>Hudgens</surname><given-names>MG</given-names></name><name><surname>Knight</surname><given-names>RJ</given-names></name><name><surname>Soko</surname><given-names>A</given-names></name><name><surname>Jamieson</surname><given-names>DJ</given-names></name><name><surname>van der Horst</surname><given-names>CM</given-names></name><name><surname>Adair</surname><given-names>LS</given-names></name></person-group><year>2012</year><article-title>Use of lipid-based nutrient supplements by HIV-infected Malawian women during lactation has no effect on infant growth from 0 to 24 weeks</article-title><source>Journal of Nutrition</source><volume>142</volume><fpage>1350</fpage><lpage>1356</lpage><pub-id pub-id-type="pmid">22649265</pub-id></element-citation></ref><ref id="R7"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Gill</surname><given-names>TM</given-names></name></person-group><year>2014</year><article-title>Disentangling the disabling process: Insights from the precipitating events project</article-title><source>Gerontologist</source><volume>54</volume><fpage>533</fpage><lpage>549</lpage><pub-id pub-id-type="pmid">25035454</pub-id></element-citation></ref><ref id="R8"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Gill</surname><given-names>TM</given-names></name><name><surname>Desai</surname><given-names>MM</given-names></name><name><surname>Gahbauer</surname><given-names>EA</given-names></name><name><surname>Holford</surname><given-names>TR</given-names></name><name><surname>Williams</surname><given-names>CS</given-names></name></person-group><year>2001</year><article-title>Restricted activity among community-living older persons: Incidence, precipitants, and health care utilization</article-title><source>Annals of Internal Medicine</source><volume>135</volume><fpage>313</fpage><lpage>321</lpage><pub-id pub-id-type="pmid">11529694</pub-id></element-citation></ref><ref id="R9"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Guo</surname><given-names>X</given-names></name><name><surname>Carlin</surname><given-names>BP</given-names></name></person-group><year>2004</year><article-title>Separate and joint modeling of longitudinal and event time data using standard computer packages</article-title><source>American Statistician</source><volume>58</volume><fpage>16</fpage><lpage>24</lpage></element-citation></ref><ref id="R10"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Henderson</surname><given-names>R</given-names></name><name><surname>Diggle</surname><given-names>P</given-names></name><name><surname>Dobson</surname><given-names>A</given-names></name></person-group><year>2000</year><article-title>Joint modelling of longitudinal measurements and event time data</article-title><source>Biostatistics</source><volume>1</volume><fpage>465</fpage><lpage>480</lpage><pub-id pub-id-type="pmid">12933568</pub-id></element-citation></ref><ref id="R11"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>van der Horst</surname><given-names>C</given-names></name><name><surname>Chasela</surname><given-names>C</given-names></name><name><surname>Ahmed</surname><given-names>Y</given-names></name><name><surname>Hoffman</surname><given-names>I</given-names></name><name><surname>Hosseinipour</surname><given-names>M</given-names></name><name><surname>Knight</surname><given-names>R</given-names></name><name><surname>Fiscus</surname><given-names>S</given-names></name><name><surname>Hudgens</surname><given-names>M</given-names></name><name><surname>Kazembe</surname><given-names>P</given-names></name><name><surname>Bentley</surname><given-names>M</given-names></name><name><surname>Adair</surname><given-names>L</given-names></name><name><surname>Piwoz</surname><given-names>E</given-names></name><name><surname>Martinson</surname><given-names>F</given-names></name><name><surname>Duerr</surname><given-names>A</given-names></name><name><surname>Kourtis</surname><given-names>A</given-names></name><name><surname>Loeliger</surname><given-names>AE</given-names></name><name><surname>Tohill</surname><given-names>B</given-names></name><name><surname>Ellington</surname><given-names>S</given-names></name><name><surname>Jamieson</surname><given-names>D</given-names></name></person-group><year>2009</year><article-title>Modifications of a large HIV prevention clinical trial to fit changing realities: A case study of the Breastfeeding, Antiretroviral, and Nutrition (BAN) protocol in Lilongwe, Malawi</article-title><source>Contemporary Clinical Trials</source><volume>30</volume><fpage>24</fpage><lpage>33</lpage><pub-id pub-id-type="pmid">18805510</pub-id></element-citation></ref><ref id="R12"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Kurland</surname><given-names>BF</given-names></name><name><surname>Heagerty</surname><given-names>PJ</given-names></name></person-group><year>2005</year><article-title>Directly parameterized regression conditioning on being alive: Analysis of longitudinal data truncated by deaths</article-title><source>Biostatistics</source><volume>6</volume><fpage>241</fpage><lpage>258</lpage><pub-id pub-id-type="pmid">15772103</pub-id></element-citation></ref><ref id="R13"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Kurland</surname><given-names>BF</given-names></name><name><surname>Johnson</surname><given-names>LL</given-names></name><name><surname>Egleston</surname><given-names>BL</given-names></name><name><surname>Diehr</surname><given-names>PH</given-names></name></person-group><year>2009</year><article-title>Longitudinal data with follow-up truncated by death: Match the analysis method to research aims</article-title><source>Statistical Science</source><volume>24</volume><fpage>211</fpage><lpage>222</lpage><pub-id pub-id-type="pmid">20119502</pub-id></element-citation></ref><ref id="R14"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Liang</surname><given-names>K-Y</given-names></name><name><surname>Zeger</surname><given-names>SL</given-names></name></person-group><year>1986</year><article-title>Longitudinal data analysis using generalized linear models</article-title><source>Biometrika</source><volume>73</volume><fpage>13</fpage><lpage>22</lpage></element-citation></ref><ref id="R15"><element-citation publication-type="book"><person-group person-group-type="author"><name><surname>Little</surname><given-names>RJA</given-names></name><name><surname>Rubin</surname><given-names>DB</given-names></name></person-group><year>2002</year><source>Statistical Analysis with Missing Data</source><edition>2</edition><publisher-loc>Hoboken, NJ</publisher-loc><publisher-name>Wiley</publisher-name></element-citation></ref><ref id="R16"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Pauler</surname><given-names>DK</given-names></name><name><surname>McCoy</surname><given-names>S</given-names></name><name><surname>Moinpour</surname><given-names>C</given-names></name></person-group><year>2003</year><article-title>Pattern mixture models for longitudinal quality of life studies in advanced stage disease</article-title><source>Statistics in Medicine</source><volume>22</volume><fpage>795</fpage><lpage>809</lpage><pub-id pub-id-type="pmid">12587106</pub-id></element-citation></ref><ref id="R17"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Ribaudo</surname><given-names>HJ</given-names></name><name><surname>Thompson</surname><given-names>SG</given-names></name><name><surname>Allen-Mersh</surname><given-names>TG</given-names></name></person-group><year>2000</year><article-title>A joint analysis of quality of life and survival using a random effect selection model</article-title><source>Statistics in Medicine</source><volume>19</volume><fpage>3237</fpage><lpage>3250</lpage><pub-id pub-id-type="pmid">11113957</pub-id></element-citation></ref><ref id="R18"><element-citation publication-type="book"><person-group person-group-type="author"><name><surname>Robins</surname><given-names>JM</given-names></name></person-group><year>2000</year><article-title>Marginal structural models versus structural nested models as tools for causal inference</article-title><source>Statistical Models in Epidemiology, the Environment, and Clinical Trials</source><person-group person-group-type="editor"><name><surname>Halloran</surname><given-names>ME</given-names></name><name><surname>Berry</surname><given-names>D</given-names></name></person-group><fpage>95</fpage><lpage>133</lpage><publisher-loc>New York</publisher-loc><publisher-name>Springer</publisher-name></element-citation></ref><ref id="R19"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Robins</surname><given-names>JM</given-names></name><name><surname>Hern&#x000e1;n</surname><given-names>MA</given-names></name><name><surname>Brumback</surname><given-names>B</given-names></name></person-group><year>2000</year><article-title>Marginal structural models and causal inference in epidemiology</article-title><source>Epidemiology</source><volume>11</volume><fpage>550</fpage><lpage>560</lpage><pub-id pub-id-type="pmid">10955408</pub-id></element-citation></ref><ref id="R20"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Robins</surname><given-names>JM</given-names></name><name><surname>Rotnitzky</surname><given-names>A</given-names></name><name><surname>Zhao</surname><given-names>LP</given-names></name></person-group><year>1995</year><article-title>Analysis of semiparametric regression models for repeated outcomes in the presence of missing data</article-title><source>Journal of the American Statistical Association</source><volume>90</volume><fpage>106</fpage><lpage>121</lpage></element-citation></ref><ref id="R21"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Rubin</surname><given-names>DB</given-names></name></person-group><year>1976</year><article-title>Inference and missing data</article-title><source>Biometrika</source><volume>63</volume><fpage>581</fpage><lpage>592</lpage></element-citation></ref><ref id="R22"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Scharfstein</surname><given-names>DO</given-names></name><name><surname>Rotnitzky</surname><given-names>A</given-names></name><name><surname>Robins</surname><given-names>JM</given-names></name></person-group><year>1999</year><article-title>Adjusting for nonignorable drop-out using semiparametric nonresponse models</article-title><source>Journal of the American Statistical Association</source><volume>94</volume><fpage>1096</fpage><lpage>1120</lpage></element-citation></ref><ref id="R23"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Shardell</surname><given-names>M</given-names></name><name><surname>Miller</surname><given-names>RR</given-names></name></person-group><year>2008</year><article-title>Weighted estimating equations for longitudinal studies with death and non-monotone missing time-dependent covariates and outcomes</article-title><source>Statistics in Medicine</source><volume>27</volume><fpage>1008</fpage><lpage>1025</lpage><pub-id pub-id-type="pmid">17579923</pub-id></element-citation></ref><ref id="R24"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Wooldridge</surname><given-names>JM</given-names></name></person-group><year>2007</year><article-title>Inverse probability weighted estimation for general missing data problems</article-title><source>Journal of Econometrics</source><volume>141</volume><fpage>1281</fpage><lpage>1301</lpage></element-citation></ref></ref-list><bio id="B1"><p id="P64">Eric J. Daza, DrPH, is a postdoctoral research fellow in the Stanford Prevention Research Center at Stanford University School of Medicine. His research focuses on causal inference, longitudinal missing-data methods, personalized and mobile health (mhealth), quantified-self projects and <italic>n</italic>-of-1 trials, Asian-American health (focusing on Filipinos), gut-microbiome research, and reproducibility.</p></bio><bio id="B2"><p id="P65">Michael G. Hudgens, PhD, is a professor in the Department of Biostatistics at the University of North Carolina at Chapel Hill. His research focuses on survival analysis, causal inference, infectious diseases, and epidemiology. He is the Director of the Center for AIDS Research Biostatistics Core.</p></bio><bio id="B3"><p id="P66">Amy H. Herring, ScD, is a professor in both the Department of Biostatistics and the Carolina Population Center at the University of North Carolina at Chapel Hill. Her research focuses on developing semiparametric Bayesian hierarchical models for highly correlated exposures, expo- sures to mixtures, and multivariate outcomes; developing statistical methods for missing and mismeasured exposure data; and applications to environmental and reproductive epidemiology.</p></bio><app-group><app id="APP1"><title>Appendix: NLSYW example creation code</title><preformat>
use "<ext-link ext-link-type="uri" xlink:href="http://www.stata-press.com/data/r14/nlswork5.dta">http://www.stata-press.com/data/r14/nlswork5.dta</ext-link>"
** Only keep records for subsample women with any survey responses available
** from years 70 through 73, 77, 78, and 80. We start at year 70 because the
** binary outcome of interest (union) is completely missing for years 68 and 69.
keep idcode year
keep if (70 &#x0003c;= year &#x00026; year &#x0003c;= 80 &#x00026; year != 75)
generate dummy = 1
reshape wide dummy, i(idcode) j(year)
egen yearsavailable = rowtotal(dummy*)
keep if (yearsavailable == 7)
keep idcode
merge 1:m idcode using "<ext-link ext-link-type="uri" xlink:href="http://www.stata-press.com/data/r14/nlswork5.dta">http://www.stata-press.com/data/r14/nlswork5.dta</ext-link>"
keep if (_merge == 3 &#x00026; 70 &#x0003c;= year &#x00026; year &#x0003c;= 80 &#x00026; year != 75)
keep idcode year age ln_wage ttl_exp birth_yr collgrad union
misstable summarize union
** Identify first and last years of any observations.
sort idcode year
by idcode : egen yearidx = seq()
foreach outcomevar in union {
   generate _firstyearRD1`outcomevar&#x000b4; = (`outcomevar&#x000b4; &#x0003c; .)
   generate firstyearRD1`outcomevar&#x000b4; = .
   replace firstyearRD1`outcomevar&#x000b4; = _firstyearRD1`outcomevar&#x000b4;     ///
         if (yearidx == 1)
   replace firstyearRD1`outcomevar&#x000b4; =                               ///
         _firstyearRD1`outcomevar&#x000b4; * firstyearRD1`outcomevar&#x000b4;[_n&#x02212;1] ///
         if (yearidx &#x0003e; 1)
   drop _firstyearRD1`outcomevar&#x000b4;
   rename firstyearRD1`outcomevar&#x000b4; RD`outcomevar&#x000b4;
   replace `outcomevar&#x000b4; =. if (RD`outcomevar&#x000b4; == 0)
}
keep idcode yearidx year union birth_yr age collgrad ttl_exp ln_wage RDunion
tempfile nlswork5_sub1
save "`nlswork5_sub1&#x000b4;", replace
** Generate no truncation in year 70 and generate truncation based on union
** status at previous year for all subsequent years.
use "`nlswork5_sub1&#x000b4;", clear
keep idcode yearidx year union
sort idcode yearidx
reshape wide union year, i(idcode) j(yearidx)
generate truncyear = .
generate Ci1 = 1
local yearidx = 1
forvalues yearidx = 2/7 {
   local yearidxminus1 = `yearidx&#x000b4; &#x02212; 1
   set seed 140925
   generate lambda`yearidx&#x000b4; = 0.8
   replace lambda`yearidx&#x000b4; = 0.8 &#x02212; 0.65 * (`yearidx&#x000b4; / 7) if ///
     (union`yearidxminus1&#x000b4; == 1)
   replace lambda`yearidx&#x000b4; = 0.8 + 0.05 * (`yearidx&#x000b4; / 7) if ///
      (union`yearidxminus1&#x000b4; == 0)
   generate Ci`yearidx&#x000b4; = Ci`yearidxminus1&#x000b4; * rbinomial(1, lambda`yearidx&#x000b4;)
   replace truncyear = year`yearidx&#x000b4; if (Ci`yearidx&#x000b4; == 0 &#x00026; Ci`yearidxminus1&#x000b4; == 1)
}
reshape long union year Ci, i(idcode) j(yearidx)
merge 1:1 idcode yearidx using "`nlswork5_sub1&#x000b4;"
drop _merge
foreach varname in union RDunion {
   replace `varname&#x000b4; =. if (truncyear &#x0003c;. &#x00026; year &#x0003e;= truncyear)
}
keep idcode year yearidx truncyear union age ln_wage ttl_exp birth_yr collgrad
order idcode year yearidx truncyear union age ln_wage ttl_exp birth_yr collgrad
compress
label data "NLS: Young women 14&#x02013;26 years of age in 1968. Example dataset for ///
   xtrccipw."
</preformat></app></app-group></back><floats-group><fig id="F1" orientation="portrait" position="float"><label>Figure 1</label><caption><p id="P67">Predicted trajectories for PEP data by risk group</p></caption><graphic xlink:href="nihms913429f1"/></fig><table-wrap id="T1" position="float" orientation="landscape"><label>Table 1</label><caption><p id="P68">Example dataset</p></caption><table frame="hsides" rules="groups"><thead><tr><th align="center" rowspan="1" colspan="1">
<monospace>idvar</monospace></th><th align="center" rowspan="1" colspan="1">
<monospace>timevar</monospace></th><th align="center" rowspan="1" colspan="1">
<monospace>timeidxvar</monospace></th><th align="center" rowspan="1" colspan="1">
<monospace>outcomevar</monospace></th><th align="center" rowspan="1" colspan="1">
<monospace>tdindepvar</monospace></th><th align="center" rowspan="1" colspan="1">
<monospace>tiindepvar</monospace></th><th align="center" rowspan="1" colspan="1">
<monospace>trtimevar</monospace></th><th align="center" rowspan="1" colspan="1"><italic>C<sub>j</sub></italic></th><th align="center" rowspan="1" colspan="1"><italic>R<sub>j</sub></italic></th><th align="center" rowspan="1" colspan="1"><italic>S</italic></th></tr></thead><tbody><tr><td align="center" rowspan="1" colspan="1">1</td><td align="center" rowspan="1" colspan="1">05apr1979</td><td align="center" rowspan="1" colspan="1">1</td><td align="center" rowspan="1" colspan="1">13</td><td align="center" rowspan="1" colspan="1">432</td><td align="center" rowspan="1" colspan="1">yes</td><td align="center" rowspan="1" colspan="1">.</td><td align="center" rowspan="1" colspan="1">1</td><td align="center" rowspan="1" colspan="1">1</td><td align="center" rowspan="1" colspan="1">3</td></tr><tr><td align="center" rowspan="1" colspan="1">1</td><td align="center" rowspan="1" colspan="1">04may1979</td><td align="center" rowspan="1" colspan="1">2</td><td align="center" rowspan="1" colspan="1">14</td><td align="center" rowspan="1" colspan="1">65</td><td align="center" rowspan="1" colspan="1">yes</td><td align="center" rowspan="1" colspan="1">.</td><td align="center" rowspan="1" colspan="1">1</td><td align="center" rowspan="1" colspan="1">1</td><td align="center" rowspan="1" colspan="1">3</td></tr><tr><td align="center" rowspan="1" colspan="1">1</td><td align="center" rowspan="1" colspan="1">05jun1979</td><td align="center" rowspan="1" colspan="1">3</td><td align="center" rowspan="1" colspan="1">08</td><td align="center" rowspan="1" colspan="1">&#x02212;5</td><td align="center" rowspan="1" colspan="1">yes</td><td align="center" rowspan="1" colspan="1">.</td><td align="center" rowspan="1" colspan="1">1</td><td align="center" rowspan="1" colspan="1">1</td><td align="center" rowspan="1" colspan="1">3</td></tr><tr><td align="center" rowspan="1" colspan="1">2</td><td align="center" rowspan="1" colspan="1">18sep1982</td><td align="center" rowspan="1" colspan="1">1</td><td align="center" rowspan="1" colspan="1">24</td><td align="center" rowspan="1" colspan="1">83</td><td align="center" rowspan="1" colspan="1">no</td><td align="center" rowspan="1" colspan="1">.</td><td align="center" rowspan="1" colspan="1">1</td><td align="center" rowspan="1" colspan="1">1</td><td align="center" rowspan="1" colspan="1">3</td></tr><tr><td align="center" rowspan="1" colspan="1">2</td><td align="center" rowspan="1" colspan="1">20oct1982</td><td align="center" rowspan="1" colspan="1">2</td><td align="center" rowspan="1" colspan="1">32</td><td align="center" rowspan="1" colspan="1">23</td><td align="center" rowspan="1" colspan="1">no</td><td align="center" rowspan="1" colspan="1">.</td><td align="center" rowspan="1" colspan="1">1</td><td align="center" rowspan="1" colspan="1">1</td><td align="center" rowspan="1" colspan="1">3</td></tr><tr><td align="center" rowspan="1" colspan="1">2</td><td align="center" rowspan="1" colspan="1">21nov1982</td><td align="center" rowspan="1" colspan="1">3</td><td align="center" rowspan="1" colspan="1">.</td><td align="center" rowspan="1" colspan="1">.</td><td align="center" rowspan="1" colspan="1">no</td><td align="center" rowspan="1" colspan="1">.</td><td align="center" rowspan="1" colspan="1">1</td><td align="center" rowspan="1" colspan="1">0</td><td align="center" rowspan="1" colspan="1">3</td></tr><tr><td align="center" rowspan="1" colspan="1">3</td><td align="center" rowspan="1" colspan="1">15sep1983</td><td align="center" rowspan="1" colspan="1">1</td><td align="center" rowspan="1" colspan="1">25</td><td align="center" rowspan="1" colspan="1">441</td><td align="center" rowspan="1" colspan="1">no</td><td align="center" rowspan="1" colspan="1">16nov1983</td><td align="center" rowspan="1" colspan="1">1</td><td align="center" rowspan="1" colspan="1">1</td><td align="center" rowspan="1" colspan="1">2</td></tr><tr><td align="center" rowspan="1" colspan="1">3</td><td align="center" rowspan="1" colspan="1">19oct1983</td><td align="center" rowspan="1" colspan="1">2</td><td align="center" rowspan="1" colspan="1">23</td><td align="center" rowspan="1" colspan="1">76</td><td align="center" rowspan="1" colspan="1">no</td><td align="center" rowspan="1" colspan="1">16nov1983</td><td align="center" rowspan="1" colspan="1">1</td><td align="center" rowspan="1" colspan="1">1</td><td align="center" rowspan="1" colspan="1">2</td></tr><tr><td align="center" rowspan="1" colspan="1">3</td><td align="center" rowspan="1" colspan="1">16nov1983</td><td align="center" rowspan="1" colspan="1">3</td><td align="center" rowspan="1" colspan="1">*</td><td align="center" rowspan="1" colspan="1">*</td><td align="center" rowspan="1" colspan="1">*</td><td align="center" rowspan="1" colspan="1">16nov1983</td><td align="center" rowspan="1" colspan="1">0</td><td align="center" rowspan="1" colspan="1">*</td><td align="center" rowspan="1" colspan="1">2</td></tr><tr><td align="center" rowspan="1" colspan="1">4</td><td align="center" rowspan="1" colspan="1">14jan1979</td><td align="center" rowspan="1" colspan="1">1</td><td align="center" rowspan="1" colspan="1">15</td><td align="center" rowspan="1" colspan="1">&#x02212;23</td><td align="center" rowspan="1" colspan="1">no</td><td align="center" rowspan="1" colspan="1">24feb1979</td><td align="center" rowspan="1" colspan="1">1</td><td align="center" rowspan="1" colspan="1">1</td><td align="center" rowspan="1" colspan="1">2</td></tr><tr><td align="center" rowspan="1" colspan="1">4</td><td align="center" rowspan="1" colspan="1">14feb1979</td><td align="center" rowspan="1" colspan="1">2</td><td align="center" rowspan="1" colspan="1">.</td><td align="center" rowspan="1" colspan="1">.</td><td align="center" rowspan="1" colspan="1">no</td><td align="center" rowspan="1" colspan="1">24feb1979</td><td align="center" rowspan="1" colspan="1">1</td><td align="center" rowspan="1" colspan="1">0</td><td align="center" rowspan="1" colspan="1">2</td></tr><tr><td align="center" rowspan="1" colspan="1">4</td><td align="center" rowspan="1" colspan="1">16mar1979</td><td align="center" rowspan="1" colspan="1">3</td><td align="center" rowspan="1" colspan="1">*</td><td align="center" rowspan="1" colspan="1">*</td><td align="center" rowspan="1" colspan="1">*</td><td align="center" rowspan="1" colspan="1">24feb1979</td><td align="center" rowspan="1" colspan="1">0</td><td align="center" rowspan="1" colspan="1">*</td><td align="center" rowspan="1" colspan="1">2</td></tr></tbody></table></table-wrap><table-wrap id="T2" position="float" orientation="portrait"><label>Table 2</label><caption><p id="P69">Simulation study results: Empirical relative bias (coverage probability)</p></caption><table frame="hsides" rules="groups"><thead><tr><th align="left" rowspan="1" colspan="1"/><th align="right" rowspan="1" colspan="1">Intercept<break/>(<italic>&#x003b2;</italic><sub>0</sub> = &#x02212; 2.19)</th><th align="right" rowspan="1" colspan="1">Sex<break/>(<italic>&#x003b2;</italic><sub>1</sub> = 0.50)</th><th align="right" rowspan="1" colspan="1">Time<break/>(<italic>&#x003b2;</italic><sub>2</sub> = 0.10)</th><th align="right" rowspan="1" colspan="1">Sex &#x000d7; Time<break/>(<italic>&#x003b2;</italic><sub>3</sub> = &#x02212;0.025)</th></tr></thead><tbody><tr><td align="left" rowspan="1" colspan="1">IEE</td><td align="right" rowspan="1" colspan="1">2 (93.7)</td><td align="right" rowspan="1" colspan="1">3 (100.0)</td><td align="right" rowspan="1" colspan="1">&#x02212;16 (73.5)</td><td align="right" rowspan="1" colspan="1">&#x02212;14 (99.1)</td></tr><tr><td align="left" rowspan="1" colspan="1">GEE-AR1</td><td align="right" rowspan="1" colspan="1">8 (81.0)</td><td align="right" rowspan="1" colspan="1">&#x02212;2 (99.6)</td><td align="right" rowspan="1" colspan="1">2 (94.9)</td><td align="right" rowspan="1" colspan="1">&#x02212;33 (97.3)</td></tr><tr><td align="left" rowspan="1" colspan="1">RCC</td><td align="right" rowspan="1" colspan="1">0 (94.8)</td><td align="right" rowspan="1" colspan="1">1 (99.7)</td><td align="right" rowspan="1" colspan="1">0 (95.5)</td><td align="right" rowspan="1" colspan="1">1 (97.8)</td></tr></tbody></table></table-wrap></floats-group></article>