Dear users,
my aim is to do a non-inferiority test by means of proc mixed with lsmestimate using multiple imputation.
I have generated the mi dataset and have generated the outcomes of the proc mixed model with lsmestimate providing the required one-sided tests and CIs for each imputation.
Is it possible to pool the analyses using mianalyze?
I managed to tronsform the file, so that mianalyze pools at least the estimates and SEs.
Is it only possible to calculate the one-sided tests and the CIs by hand?
Best regards,
Maciej
If I understand correctly, you have obtained the test statistic for each imputation in addition to the estimate and SE. MIANALYZE will correctly combine the estimates (a contrast for each imputation) to give you a global estimate, but you want a global test for significance. This can't be done with a PROC, but Paul Allison wrote a nice macro to do this based on the work by Li et al (Li, K. H., Meng, X. L., Raghunathan, T. E., and Rubin D. B. 1991. Significance levels from repeated P-values with multiply-imputed data. Statitsica Sin. 1:65-92.) and Schafer (1997. Analysis of Incomplete Multivariate Data. London - UK: Chapman and Hall. 444pp.). The macro combines chi-square test statistics from each imputation to estimate a global F statistic for significance. If the test statistic for your problem is a student t for each imputation, then simply square the t values to obtain chi-square statistics for each imputation (the square of a t is a F statistic, but with 1 numerical df, chi-square and F are the same). If your test statistic for each impuation is an F statistic, then multiply the F by the numerical df to obtain the chi-square. (This all assume that you have reasonably large denominator df. ) The macro works by having a file with only one variable, the chi-square test statistic for each impuation. It is run with:
%combchi(df=1, data=DATAFILE);
One does not use the denominator df.
Macro:
%macro combchi(df=,chi=,data=); *---From Paul Allison (pooling chi-squared tests for significance across all imputation results; proc iml; DF=&df; %if &chi ^= and &data ^= %then %do; print, "Error: Can't specify both CHI= and DATA="; abort; %end; %if &chi ^= %then %do; g2={&chi}; %end; %if &data ^= %then %do; use &data; read all into g1; g2=g1`; %end; m=ncol(g2); g=sqrt(g2); mg2=sum(g2)/m; r=(1+1/m)*(ssq(g)-(sum(g)**2)/m)/(m-1); F=(mg2/df - r*(m+1)/(m-1))/(1+r); DDF=(m-1)*(1+1/r)**2/df**(3/m); P=1-probf(f,df,ddf); print f df ddf; print p; run; quit; %mend combchi;
Example here is when there is 1 numerator df for each test. There is another way to run the macro where there is no datafile, but one inputs the test values directly (not discussed here).
Very important: the datafile input to the macro can only have ONE variable (one column), with the test statistics. You need to create a datafile by keeping only this variable.
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.
Find more tutorials on the SAS Users YouTube channel.