Hello,
For my analysis, I have used PROC MI to produce 10 imputed datasets for 5 categorical variables with missing data. I am trying to create a Table 1 with participant characteristics using the imputed datasets. I was able to use PROC FREQ to get the frequencies by imputation, but I cannot get the PROC MIANALYZE to work. Here is the code that wrote:
/* Step 1: imputation*/
proc mi data=mydata out=mi_data nimpute=10 seed=12345;
class race exposure income_cat;
fcs logistic(exposure)
discrim(race income_cat);
var race exposure income_cat age bmi outcome;
run;
/* Step 2: Analysis */
proc freq data=mi_data;
by _Imputation_;
tables exposure race income_cat;
run;
/* Step 3: Pool results */
proc mianalyze data=mi_data;
modeleffects exposure race income_cat;
run;
Is it possible (or is it frowned upon) to get frequencies for multiply imputed data? The only examples I have seen once completing imputation is when you are doing a regression.
What exactly does " I cannot get the PROC MIANALYZE to work" mean? Do you get errors, unexpected output, no output?
It is more useful to post the LOG with any messages generated and the code as the messages often provide details as to what is happening. Copy the step or procedures in question from the log, on the forum open a text box using the </> icon that appears above the main message window and paste the text in the box. The box will preserve the formatting from the log.
As far as I know ... the procedure in the middle (between the mi and mianalyze procedures) should be a modelling procedure. In other words ... the procedure in the middle should build a mathematical/statistical model for estimation, simulation, forecasting, or classification. Often the mathematical/statistical model takes the form of an equation (or equations). Such a model has parameters!
In the DATA= option of PROC MIANALYZE ... some specific data are expected to be there ... like parameter estimates and associated standard errors!
From the documentation:
names an input SAS data set.
1. If the input DATA= data set is not a specially structured SAS data set, the data set contains both the parameter estimates and associated standard errors. The parameter estimates are specified in the MODELEFFECTS statement and the standard errors are specified in the STDERR statement.
2. If the data set is a specially structured input SAS data set, it must have a TYPE of EST, COV, or CORR that contains estimates from imputed data sets:
If TYPE=EST, the data set contains the parameter estimates and associated covariance matrices.
If TYPE=COV, the data set contains the sample means, sample sizes, and covariance matrices. Each covariance matrix for variables is divided by the sample size n to create the covariance matrix for parameter estimates.
If TYPE=CORR, the data set contains the sample means, sample sizes, standard errors, and correlation matrices. The covariance matrices are computed from the correlation matrices and associated standard errors. Each covariance matrix for variables is divided by the sample size n to create the covariance matrix for parameter estimates.
If you do not specify an input data set with the DATA= or PARMS= option, then the most recently created SAS data set is used as an input DATA= data set. See the section Input Data Sets for a detailed description of the input data sets.
BR, Koen
For some blog-articles on mi in combination with mianalyze
, you can perform this Google Search:
mi mianalyze site:blogs.sas.com
BR, Koen
Dive into keynotes, announcements and breakthroughs on demand.
Explore Now →Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.