The results above extend to the longitudinal case under

the ignorability and positivity conditions.

You can look at that formula and

you can see that basically I'm multiplying these weights up through time t.

Robins and Hernan called these weights unstabilized, and the stabilized weights

are the ones where you have the additional term in the numerator.

So in order to estimate the expectation of Y1 at z1, this little z1, one proceeds as

before weighting inversely by an estimate of the stabilized or unstabilized weight.

Now at the next step you want to estimate E(Y(z1, z2) as the treatment sub regimen.

And the units observed in period 2 with Z1,

the random variable Z1 = z1 and the random variable Z2 = z2.

So you have to reweight these units so that the observations with covariates

x1 and x2 have the same frequency as the observations with the same

values of the covariates, but with Z1 = z1* and Z2 = to z2*, etc.

And as before, you need to estimate the weights and as t increases,

it will generally be necessary to model the outcome as well, for example,

this structural model below.

So clearly, our previous concerns about misspecification above for the case T = 1

may apply here as well, but they apply more forcefully as the opportunities for

misspecification increase because you're doing the weighting more times.

I haven't done it but

you can include baseline covariates W in the marginal structural model.

And then we're going to do that, Hernan and Robins,

the book recommends using modified stabilized weights as these leads to

smaller standard errors in unstabilized weights.

As both the g-formula and inverse probability treatment waiting

can be used to estimate this treatment effect up through time little t,

comparing sub regimen Zt and Zt* or baseline core variates as well.

But it's useful to look at the advantages and

disadvantages associated with each approach.

As we noted before, using the g-formula would generally require modelling

this expected value or the conditional expectations for yt.

And it will usually require modelling a probability functions, for

the covariates given prior covariates and prior treatments.

So both of these can be quite challenging.

Now, using IPTW requires modelling the assignment probabilities,

conditional on past covariates assignments.

And although it appears that IPTW does not require modelling the outcomes,

remember that as t increases, the number of treatment regiments increases

exponentially and then you're also going to probably need a model for the outcomes.