# KeepNotes blog

Stay hungry, Stay Foolish.

0%

In the previous article (Understanding Multiple Imputation in SAS), we talked about how to implement multiple imputation in the SAS procedure to compare the difference between the treatment and placebo groups. Let's look at how to do it in non-inferiority and superiority trials, which differ from common use.

In terms of the ANCOVA model, if you would like to add the margin of non-inferiority and superiority, you can just use the `lsmestimate` statement with `testvalue=2` when the margin is 2. Whereas for multiple imputation you can't just add this statement in the analysis step, you should define this margin in the pool step.

In order to echo the last article, here I will use the identical example data, first and second steps of the MI process, and just illustrate the difference in the third step. Assume that the endpoint is the change from baseline at week 6, and given that this drug is used to reduce the primary indicator, the null hypothesis might be that the CHG in the treatment group minus the placebo group is more than `-2`, demonstrating that the drug efficacy is not superior to placebo.

``````ods output ParameterEstimates=super;
proc mianalyze data=diff theta0=-2;
modeleffects estimate;
stderr stderr;
run;``````

The combined imputation with a margin of `-2` as following.

Now we can find the `Theta0` value is `-2` rather than the usual and default `0`. And the two-sided p-value is `0.4745`. If we would like to obtain the one-sided p-value, an additional calculation can be done. Or just a half of a two-sided p-value is also fine, which is the same.

``````data super;
set super;
pval = (1 - probt(abs(tvalue),df));
run;``````

Otherwise the t-statistic and p-value can also be computed by the t distribution formula, as shown below in R.

``````est <- -2.803439
theta0 <- -2
se <- 1.123403
df <- 4800.7

t <- (est - theta0) / se
> t
[1] -0.7151832

pval <- pt(t, df)
> pval
[1] 0.2372653``````

The superiority test is used as an example above, however non-inferiority test can follow the same procedure by simply altering the margin.